From a36dfda7e62a0127342599f39d76930885d0b400 Mon Sep 17 00:00:00 2001 From: Chris Brown Date: Mon, 16 Oct 2023 16:48:43 -0400 Subject: [PATCH] Sync relevant docs between v5 and v6 --- docs/basic-usage/middleware.md | 2 ++ docs/basic-usage/teams-permissions.md | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/basic-usage/middleware.md b/docs/basic-usage/middleware.md index 09cbe086f..9643f591d 100644 --- a/docs/basic-usage/middleware.md +++ b/docs/basic-usage/middleware.md @@ -38,6 +38,8 @@ protected $middlewareAliases = [ ]; ``` +**YOU SHOULD ALSO** set [the `$middlewarePriority` array](https://laravel.com/docs/master/middleware#sorting-middleware) to include this package's middleware before the `SubstituteBindings` middleware, else you may get *404 Not Found* responses when a *403 Not Authorized* response might be expected. + ## Middleware via Routes Then you can protect your routes using middleware rules: diff --git a/docs/basic-usage/teams-permissions.md b/docs/basic-usage/teams-permissions.md index d60657377..b34e6add5 100644 --- a/docs/basic-usage/teams-permissions.md +++ b/docs/basic-usage/teams-permissions.md @@ -35,7 +35,8 @@ Example Team Middleware: ```php namespace App\Http\Middleware; -class TeamsPermission{ +class TeamsPermission +{ public function handle($request, \Closure $next){ if(!empty(auth()->user())){ @@ -52,7 +53,8 @@ class TeamsPermission{ } } ``` -NOTE: You must add your custom `Middleware` to `$middlewarePriority` in `app/Http/Kernel.php`. + +**YOU MUST ALSO** set [the `$middlewarePriority` array](https://laravel.com/docs/master/middleware#sorting-middleware) in `app/Http/Kernel.php` to include your custom middleware before the `SubstituteBindings` middleware, else you may get *404 Not Found* responses when a *403 Not Authorized* response might be expected. ## Roles Creating