diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 7c532850..0b418b81 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -65,5 +65,27 @@ class Kernel extends HttpKernel 'signed' => \App\Http\Middleware\ValidateSignature::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, + 'permission' => \Spatie\Permission\Middleware\PermissionMiddleware::class, + ]; + + /** + * The priority-sorted list of middleware. + * + * This forces non-global middleware to always be in the given order. + * + * @var string[] + */ + protected $middlewarePriority = [ + \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class, + \Illuminate\Cookie\Middleware\EncryptCookies::class, + \Illuminate\Session\Middleware\StartSession::class, + \Illuminate\View\Middleware\ShareErrorsFromSession::class, + \Illuminate\Contracts\Auth\Middleware\AuthenticatesRequests::class, + \Illuminate\Routing\Middleware\ThrottleRequests::class, + \Illuminate\Routing\Middleware\ThrottleRequestsWithRedis::class, + \Illuminate\Contracts\Session\Middleware\AuthenticatesSessions::class, + \Spatie\Permission\Middleware\PermissionMiddleware::class, + \Illuminate\Routing\Middleware\SubstituteBindings::class, + \Illuminate\Auth\Middleware\Authorize::class, ]; } diff --git a/app/Permissions/.gitkeep b/app/Permissions/.gitkeep new file mode 100644 index 00000000..e69de29b