Skip to content

Commit 7090824

Browse files
committed
Merge doc updates
1 parent 54a78e7 commit 7090824

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/basic-usage/blade-directives.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ weight: 7
55

66
## Permissions
77
This package doesn't add any **permission**-specific Blade directives.
8-
Instead, use Laravel's native `@can` directive to check if a user has a certain permission.
8+
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):
99

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

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

30-
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.
30+
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.
3131

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

@@ -48,6 +48,12 @@ is the same as
4848
I am not a writer...
4949
@endhasrole
5050
```
51+
which is also the same as
52+
```php
53+
@if(auth()->user()->hasRole('writer'))
54+
//
55+
@endif
56+
```
5157

5258
Check for any role in a list:
5359
```php

0 commit comments

Comments
 (0)