Skip to content

Commit

Permalink
Add another example
Browse files Browse the repository at this point in the history
  • Loading branch information
drbyte committed Apr 3, 2024
1 parent 8ed61aa commit d26563e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/basic-usage/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,14 @@ Route::group(['middleware' => ['permission:publish articles|edit articles,api']]

### Controllers

In Laravel 11, if your controller implements the `HasMiddleware` interface, you can register controller middleware using the `middleware()` method:
In Laravel 11, if your controller implements the `HasMiddleware` interface, you can register [controller middleware](https://laravel.com/docs/11.x/controllers#controller-middleware) using the `middleware()` method:

```php
public static function middleware(): array
{
return [
'role_or_permission:manager|edit articles',
new Middleware('role:author', only: ['index']),
];
}
```
Expand Down

0 comments on commit d26563e

Please sign in to comment.