Skip to content

Commit d26563e

Browse files
authored
Add another example
1 parent 8ed61aa commit d26563e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/basic-usage/middleware.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,14 @@ Route::group(['middleware' => ['permission:publish articles|edit articles,api']]
8585

8686
### Controllers
8787

88-
In Laravel 11, if your controller implements the `HasMiddleware` interface, you can register controller middleware using the `middleware()` method:
88+
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:
8989

9090
```php
9191
public static function middleware(): array
9292
{
9393
return [
9494
'role_or_permission:manager|edit articles',
95+
new Middleware('role:author', only: ['index']),
9596
];
9697
}
9798
```

0 commit comments

Comments
 (0)