public function handle(Request $request, Closure $next, $ability = null)
    {
        if (Auth::check() && $request->user()->can($ability ?: $this->requestedAbility($request), $request)) {
            return $next($request);
        }
        // TODO make abort 403 action configurable
        abort(403);
    }
public function handle(Request $request, Closure $next, $ability = null)
    {
        if (Auth::check() && $request->user()->can($ability ?: $this->requestedAbility($request), $request)) {
            return $next($request);
        }
        // TODO make abort 403 action configurable
        abort(403);
    }
public function handle ( Request $ request , Closure $ next , $ ability = null ) { if ( Auth :: check ( ) && $ request -> user ( ) -> can ( $ ability ? : $ this -> requestedAbility ( $ request ) , $ request ) ) { return $ next ( $ request ) ; } // TODO make abort 403 action configurable abort ( 403 ) ; }
Check user authorization.

@param \Illuminate\Http\Request $request
@param \Closure                 $next
@param string                   $ability

@return mixed
Check user authorization .