Skip to content

Commit

Permalink
docs: add gate usage
Browse files Browse the repository at this point in the history
  • Loading branch information
leeqvip committed Dec 24, 2024
1 parent 772aa09 commit 2df3d03
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ if (Enforcer::enforce("eve", "articles", "edit")) {

```

By default, [Gate](https://laravel.com/docs/11.x/authorization#gates) checks will be automatically intercepted
. You can check if a user has a permission with Laravel's default `can` function:

```php
$user->can('articles,read');
```

### Using Enforcer Api

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

0 comments on commit 2df3d03

Please sign in to comment.