Skip to content

Commit 9e4f5c0

Browse files
committed
docs: remplace model('UserModel') with auth()->getProvider()
1 parent da1666f commit 9e4f5c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/quickstart.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ By default, the only values stored in the users table is the username. The first
271271
```php
272272
use CodeIgniter\Shield\Entities\User;
273273

274-
$users = model('UserModel');
274+
$users = auth()->getProvider();
275275
$user = new User([
276276
'username' => 'foo-bar',
277277
'email' => 'foo.bar@example.com',
@@ -291,7 +291,7 @@ $users->addToDefaultGroup($user);
291291
A user's data can be spread over a few different tables so you might be concerned about how to delete all of the user's data from the system. This is handled automatically at the database level for all information that Shield knows about, through the `onCascade` settings of the table's foreign keys. You can delete a user like any other entity.
292292

293293
```php
294-
$users = model('UserModel');
294+
$users = auth()->getProvider();
295295
$users->delete($user->id, true);
296296
```
297297

@@ -302,7 +302,7 @@ $users->delete($user->id, true);
302302
The `UserModel::save()`, `update()` and `insert()` methods have been modified to ensure that an email or password previously set on the `User` entity will be automatically updated in the correct `UserIdentity` record.
303303

304304
```php
305-
$users = model('UserModel');
305+
$users = auth()->getProvider();
306306
$user = $users->findById(123);
307307

308308
$user->fill([

0 commit comments

Comments
 (0)