Skip to content

Instantly share code, notes, and snippets.

@overtrue
Last active September 4, 2016 04:55
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save overtrue/ff6cd3a4e869fbaf6c01 to your computer and use it in GitHub Desktop.
Save overtrue/ff6cd3a4e869fbaf6c01 to your computer and use it in GitHub Desktop.
PHP Tips
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel {
/**
* The application's global HTTP middleware stack.
*
* @var array
*/
protected $middleware = [
'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode',
'Illuminate\Cookie\Middleware\EncryptCookies',
'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse',
'Illuminate\Session\Middleware\StartSession',
'Illuminate\View\Middleware\ShareErrorsFromSession',
];
/**
* The application's route middleware.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => 'App\Http\Middleware\Authenticate',
'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
'guest' => 'App\Http\Middleware\RedirectIfAuthenticated',
'csrf' => 'App\Http\Middleware\VerifyCsrfToken',
];
}
@khsing
Copy link

khsing commented Sep 19, 2015

5.1以后可以直接在VerifyCsrfToken中添加except route

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment