Skip to content

Commit 5252f1d

Browse files
authored
Add note to middleware about authentication (#8560)
1 parent 8baa576 commit 5252f1d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pennant.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,11 @@ Next, you may assign the middleware to a route and specify the features that are
296296
```php
297297
Route::get('/api/servers', function () {
298298
// ...
299-
})->middleware(['features:new-api,servers-api']);
299+
})->middleware(['auth', 'features:new-api,servers-api']);
300300
```
301301

302+
> **Note** As the `feature` middleware will check against the currently authenticated user, you should ensure that any authentication related middleware is applied _before_ the `feature` middleware.
303+
302304
<a name="customizing-the-response"></a>
303305
#### Customizing The Response
304306

0 commit comments

Comments
 (0)