handle() public method

Handle an incoming request.
public handle ( App\Http\Middleware\Request $request, Closure $next ) : mixed
$request App\Http\Middleware\Request
$next Closure
return mixed
 /**
  * Handle the request.
  *
  * @param \Illuminate\Http\Request $request
  * @param callable                 $next
  * @return \Illuminate\Http\RedirectResponse|mixed
  */
 public function handle($request, Closure $next)
 {
     // If the method is not a post - skip.
     if (!$request->isMethod('post')) {
         return $next($request);
     }
     // Get the route action.
     $action = $this->route->getAction();
     // If the route disabled the CSRF - skip.
     if (array_get($action, 'csrf') === false) {
         return $next($request);
     }
     /**
      * Try validating the CSRF token with the
      * base Laravel Middleware.
      */
     try {
         return parent::handle($request, $next);
     } catch (TokenMismatchException $e) {
         $this->messages->error('streams::message.csrf_token_mismatch');
         return $this->redirector->back();
     }
 }
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $this->except = array_merge($this->except, static::$staticExcept);
     return parent::handle($request, $next);
 }