<NME> VerifyCsrfToken.php
<BEF> <?php namespace App\Http\Middleware;

use Closure;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
use Illuminate\Http\Request;

/**
 * Middleware to prevent CSRF
 */
class VerifyCsrfToken extends BaseVerifier
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if ($this->excludedRoutes($request)) {
            return $this->addCookieToResponse($request, $next($request));
        }

        return parent::handle($request, $next);
    }

    /**
     * Determines whether or not the request should be excluded from CSRF protection
     *
     * @param \Illuminate\Http\Request $request
     * @return boolean
     */
    protected function excludedRoutes(Request $request)
    {
        $routes = [
            'deploy/*'
        ];

        foreach ($routes as $route) {
            if ($request->is($route)) {
                return true;
            }
        }

        return false;
    }
}
        'deploy/*',
        'logout',
    ];
}

<MSG> Cleaning up middleware for 5.1

<DFF> @@ -1,48 +1,17 @@
-<?php namespace App\Http\Middleware;
+<?php
+
+namespace App\Http\Middleware;
 
-use Closure;
 use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
-use Illuminate\Http\Request;
 
-/**
- * Middleware to prevent CSRF
- */
 class VerifyCsrfToken extends BaseVerifier
 {
     /**
-     * Handle an incoming request.
-     *
-     * @param  \Illuminate\Http\Request  $request
-     * @param  \Closure  $next
-     * @return mixed
-     */
-    public function handle($request, Closure $next)
-    {
-        if ($this->excludedRoutes($request)) {
-            return $this->addCookieToResponse($request, $next($request));
-        }
-
-        return parent::handle($request, $next);
-    }
-
-    /**
-     * Determines whether or not the request should be excluded from CSRF protection
+     * The URIs that should be excluded from CSRF verification.
      *
-     * @param \Illuminate\Http\Request $request
-     * @return boolean
+     * @var array
      */
-    protected function excludedRoutes(Request $request)
-    {
-        $routes = [
-            'deploy/*'
-        ];
-
-        foreach ($routes as $route) {
-            if ($request->is($route)) {
-                return true;
-            }
-        }
-
-        return false;
-    }
+    protected $except = [
+        'deploy/*'
+    ];
 }

{'addition_count': 8, 'commit_subject': 'Cleaning up middleware for 5.1', 'deletion_count': 39, 'file_extension': '.php', 'lang': 'php', 'license': 'mit', 'repo_name': 'REBELinBLUE/deployer'}