Skip to content

Commit

Permalink
Merge doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
drbyte committed Oct 25, 2023
1 parent 54a78e7 commit 7090824
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/basic-usage/blade-directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ weight: 7

## Permissions
This package doesn't add any **permission**-specific Blade directives.
Instead, use Laravel's native `@can` directive to check if a user has a certain permission.
Instead, use Laravel's native `@can` directive to check if a user has a certain permission (whether you gave them that permission directly or if you granted it indirectly via a role):

```php
@can('edit articles')
Expand All @@ -27,7 +27,7 @@ As discussed in the Best Practices section of the docs, **it is strongly recomme

Additionally, if your reason for testing against Roles is for a Super-Admin, see the *Defining A Super-Admin* section of the docs.

If you actually need to test for Roles, this package offers some Blade directives to verify whether the currently logged in user has all or any of a given list of roles.
If you actually need to directly test for Roles, this package offers some Blade directives to verify whether the currently logged in user has all or any of a given list of roles.

Optionally you can pass in the `guard` that the check will be performed on as a second argument.

Expand All @@ -48,6 +48,12 @@ is the same as
I am not a writer...
@endhasrole
```
which is also the same as
```php
@if(auth()->user()->hasRole('writer'))
//
@endif
```

Check for any role in a list:
```php
Expand Down

0 comments on commit 7090824

Please sign in to comment.