Browse Source

Update middleware.

Taylor Otwell 10 years ago
parent
commit
93b9415cd0

+ 7 - 7
app/Http/Kernel.php

@@ -11,13 +11,13 @@ class Kernel extends HttpKernel {
 	 * @var array
 	 */
 	protected $middleware = [
-		'App\Http\Middleware\MaintenanceMiddleware',
-		'Illuminate\Cookie\Middleware\Guard',
-		'Illuminate\Cookie\Middleware\Queue',
-		'Illuminate\Session\Middleware\Reader',
-		'Illuminate\Session\Middleware\Writer',
-		'Illuminate\View\Middleware\ErrorBinder',
-		'App\Http\Middleware\CsrfMiddleware',
+		'App\Http\Middleware\UnderMaintenance',
+		'Illuminate\Cookie\Middleware\EncryptCookies',
+		'Illuminate\Cookie\Middleware\AddQueuedCookiesToRequest',
+		'Illuminate\Session\Middleware\ReadSession',
+		'Illuminate\Session\Middleware\WriteSession',
+		'Illuminate\View\Middleware\ShareErrorsFromSession',
+		'App\Http\Middleware\ValidateCsrfToken',
 	];
 
 	/**

+ 1 - 1
app/Http/Middleware/GuestMiddleware.php → app/Http/Middleware/IsGuest.php

@@ -5,7 +5,7 @@ use Illuminate\Contracts\Auth\Guard;
 use Illuminate\Http\RedirectResponse;
 use Illuminate\Contracts\Routing\Middleware;
 
-class GuestMiddleware implements Middleware {
+class IsGuest implements Middleware {
 
 	/**
 	 * The Guard implementation.

+ 1 - 1
app/Http/Middleware/AuthMiddleware.php → app/Http/Middleware/LoggedIn.php

@@ -5,7 +5,7 @@ use Illuminate\Contracts\Auth\Guard;
 use Illuminate\Contracts\Routing\Middleware;
 use Illuminate\Contracts\Routing\ResponseFactory;
 
-class AuthMiddleware implements Middleware {
+class LoggedIn implements Middleware {
 
 	/**
 	 * The Guard implementation.

+ 1 - 1
app/Http/Middleware/BasicAuthMiddleware.php → app/Http/Middleware/LoggedInWithBasicAuth.php

@@ -4,7 +4,7 @@ use Closure;
 use Illuminate\Contracts\Auth\Guard;
 use Illuminate\Contracts\Routing\Middleware;
 
-class BasicAuthMiddleware implements Middleware {
+class LoggedInWithBasicAuth implements Middleware {
 
 	/**
 	 * The Guard implementation.

+ 1 - 1
app/Http/Middleware/MaintenanceMiddleware.php → app/Http/Middleware/UnderMaintenance.php

@@ -5,7 +5,7 @@ use Illuminate\Http\Response;
 use Illuminate\Contracts\Routing\Middleware;
 use Illuminate\Contracts\Foundation\Application;
 
-class MaintenanceMiddleware implements Middleware {
+class UnderMaintenance implements Middleware {
 
 	/**
 	 * The application implementation.

+ 2 - 2
app/Http/Middleware/CsrfMiddleware.php → app/Http/Middleware/ValidateCsrfToken.php

@@ -4,7 +4,7 @@ use Closure;
 use Illuminate\Contracts\Routing\Middleware;
 use Illuminate\Session\TokenMismatchException;
 
-class CsrfMiddleware implements Middleware {
+class ValidateCsrfToken implements Middleware {
 
 	/**
 	 * Handle an incoming request.
@@ -12,7 +12,7 @@ class CsrfMiddleware implements Middleware {
 	 * @param  \Illuminate\Http\Request  $request
 	 * @param  \Closure  $next
 	 * @return mixed
-	 * 
+	 *
 	 * @throws TokenMismatchException
 	 */
 	public function handle($request, Closure $next)

+ 4 - 4
app/Providers/RouteServiceProvider.php

@@ -22,10 +22,10 @@ class RouteServiceProvider extends ServiceProvider {
 	 * @var array
 	 */
 	protected $middleware = [
-		'auth' => 'App\Http\Middleware\AuthMiddleware',
-		'auth.basic' => 'App\Http\Middleware\BasicAuthMiddleware',
-		'csrf' => 'App\Http\Middleware\CsrfMiddleware',
-		'guest' => 'App\Http\Middleware\GuestMiddleware',
+		'auth' => 'App\Http\Middleware\LoggedIn',
+		'auth.basic' => 'App\Http\Middleware\LoggedInWithBasicAuth',
+		'csrf' => 'App\Http\Middleware\VerifyCsrfToken',
+		'guest' => 'App\Http\Middleware\IsGuest',
 	];
 
 	/**