auth = $auth; } /** * Handle an incoming request. * * @param Request $request * @param Closure $next * @return mixed */ public function handle($request, Closure $next) { if ( ! $this->auth->user()->isAdministrator()) { if ($request->ajax()) { return response('Forbbiden.', 403); } else { throw new AccessDeniedHttpException; } } return $next($request); } }