header('X-API-SECRET') && ($request->header('X-API-SECRET') == config('ninja.api_secret')) ) { return $next($request); } else { $error['error'] = ['message' => 'Invalid secret']; return response()->json(json_encode($error, JSON_PRETTY_PRINT) ,403); } } }