Skip to content

Commit cd1983c

Browse files
authored
Merge pull request #2836 from Ken-vdE/patch-1
Update multiple-guards.md
2 parents 324142c + ca77ab3 commit cd1983c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/basic-usage/multiple-guards.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ Note that this package requires you to register a permission name (same for role
2020
If your app structure does NOT differentiate between guards when it comes to roles/permissions, (ie: if ALL your roles/permissions are the SAME for ALL guards), you can override the `getDefaultGuardName` function by adding it to your User model, and specifying your desired `$guard_name`. Then you only need to create roles/permissions for that single `$guard_name`, not duplicating them. The example here sets it to `web`, but use whatever your application's default is:
2121

2222
```php
23-
protected function getDefaultGuardName(): string { return 'web'; }
23+
protected string $guard_name = 'web';
24+
protected function getDefaultGuardName(): string { return $this->guard_name; }
2425
````
2526

2627

0 commit comments

Comments
 (0)