From 2df3d03edfc96538663080d4c6f92b705b804c0f Mon Sep 17 00:00:00 2001 From: JonLee Date: Tue, 24 Dec 2024 19:03:20 +0800 Subject: [PATCH] docs: add gate usage --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index e3837f7..6ae89a0 100755 --- a/README.md +++ b/README.md @@ -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: