Skip to content

Commit 469f8b9

Browse files
committed
docs: add description for command shield:model
1 parent 92ba9d4 commit 469f8b9

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

docs/concepts.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,16 @@ on the standard Config class if nothing is found in the database.
2626

2727
You can use your own models to handle user persistence. Shield calls this the "User Provider" class. A default model
2828
is provided for you at `CodeIgniter\Shield\Models\UserModel`. You can change this in the `Config\Auth->userProvider` setting.
29-
The only requirement is that your new class MUST extend the provided `UserModel`.
29+
The only requirement is that your new class MUST extend the provided `UserModel`. Shield has a CLI command to quickly create a custom `UserModel`, for example if you run the following command in terminal:
30+
31+
```console
32+
php spark shield:model MyUserModel
33+
```
34+
35+
You should set the `Config\Auth->userProvider` as below:
3036

3137
```php
32-
public $userProvider = 'CodeIgniter\Shield\Models\UserModel';
38+
public $userProvider = 'App\Models\MyUserModel';
3339
```
3440

3541
<a name="identities" />

0 commit comments

Comments
 (0)