src/Middleware/VerifyCsrfToken.php
public function handle($request, Closure $next)
    {
        try {
            return parent::handle($request, $next);
        } catch (\Exception $exception) {
            if ($request->ajax()) {
                header('X-FORCE_FRONTEND_REDIRECT: 1');
                echo array_get($_SERVER, 'HTTP_REFERER', array_get($_SERVER, 'HTTP_ORIGIN', secure_url('')));
                exit();
            }

            return $next($request);
        }
    }
public function handle($request, Closure $next)
    {
        try {
            return parent::handle($request, $next);
        } catch (\Exception $exception) {
            if ($request->ajax()) {
                header('X-FORCE_FRONTEND_REDIRECT: 1');
                echo array_get($_SERVER, 'HTTP_REFERER', array_get($_SERVER, 'HTTP_ORIGIN', secure_url('')));
                exit();
            }

            return $next($request);
        }
    }
Handle an incoming request.

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

@return mixed