From ca2f02284c6d70a42664ac0ded6534dfa392b9f6 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 11 Nov 2014 12:51:55 -0600 Subject: [PATCH] Rename middleware to more "action" words. --- app/Http/Middleware/{Authenticated.php => Authenticate.php} | 2 +- .../Middleware/{IsGuest.php => RedirectIfAuthenticated.php} | 2 +- app/Providers/RouteServiceProvider.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) rename app/Http/Middleware/{Authenticated.php => Authenticate.php} (94%) rename app/Http/Middleware/{IsGuest.php => RedirectIfAuthenticated.php} (92%) diff --git a/app/Http/Middleware/Authenticated.php b/app/Http/Middleware/Authenticate.php similarity index 94% rename from app/Http/Middleware/Authenticated.php rename to app/Http/Middleware/Authenticate.php index 87c135c3..f96fb04f 100644 --- a/app/Http/Middleware/Authenticated.php +++ b/app/Http/Middleware/Authenticate.php @@ -4,7 +4,7 @@ use Closure; use Illuminate\Contracts\Auth\Guard; use Illuminate\Contracts\Routing\Middleware; -class Authenticated implements Middleware { +class Authenticate implements Middleware { /** * The Guard implementation. diff --git a/app/Http/Middleware/IsGuest.php b/app/Http/Middleware/RedirectIfAuthenticated.php similarity index 92% rename from app/Http/Middleware/IsGuest.php rename to app/Http/Middleware/RedirectIfAuthenticated.php index 5abfc5e0..39cf5a15 100644 --- a/app/Http/Middleware/IsGuest.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -5,7 +5,7 @@ use Illuminate\Contracts\Auth\Guard; use Illuminate\Http\RedirectResponse; use Illuminate\Contracts\Routing\Middleware; -class IsGuest implements Middleware { +class RedirectIfAuthenticated implements Middleware { /** * The Guard implementation. diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 7a9c2258..f0063a67 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -11,9 +11,9 @@ class RouteServiceProvider extends ServiceProvider { * @var array */ protected $middleware = [ - 'auth' => 'App\Http\Middleware\Authenticated', - 'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticatedWithBasicAuth', - 'guest' => 'App\Http\Middleware\IsGuest', + 'auth' => 'App\Http\Middleware\Authenticate', + 'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth', + 'guest' => 'App\Http\Middleware\RedirectIfAuthenticated', ]; /**