Skip to content

Commit 2df3d03

Browse files
committed
docs: add gate usage
1 parent 772aa09 commit 2df3d03

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: README.md

+7
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ if (Enforcer::enforce("eve", "articles", "edit")) {
123123

124124
```
125125

126+
By default, [Gate](https://laravel.com/docs/11.x/authorization#gates) checks will be automatically intercepted
127+
. You can check if a user has a permission with Laravel's default `can` function:
128+
129+
```php
130+
$user->can('articles,read');
131+
```
132+
126133
### Using Enforcer Api
127134

128135
It provides a very rich api to facilitate various operations on the Policy:

0 commit comments

Comments
 (0)