Skip to content

Commit 2f54798

Browse files
freekmurzeclaude
andcommitted
Show HasRoles import in installation step 9
The installation page only showed the in-class `use HasRoles;` without the import, so copying it literally produces a trait-not-found error. Now matches the full pattern used on the other docs pages. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8e84304 commit 2f54798

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

docs/installation-laravel.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,20 @@ See the "Prerequisites" documentation page for compatibility details.
4848
4949
php artisan migrate
5050
51-
9. **Add the necessary trait to your User model**:
51+
9. **Add the necessary trait to your User model**:
5252
53-
// The User model requires this trait
53+
```php
54+
use Illuminate\Foundation\Auth\User as Authenticatable;
55+
use Spatie\Permission\Traits\HasRoles;
56+
57+
class User extends Authenticatable
58+
{
5459
use HasRoles;
5560
61+
// ...
62+
}
63+
```
64+
5665
10. Consult the **Basic Usage** section of the docs to get started using the features of this package.
5766
5867
.

0 commit comments

Comments
 (0)