Skip to content

Commit da6e3cc

Browse files
committed
docs: add comments in sample code
1 parent 9e4f5c0 commit da6e3cc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/quickstart.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,9 @@ 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+
// Get the User Provider (UserModel by default)
274275
$users = auth()->getProvider();
276+
275277
$user = new User([
276278
'username' => 'foo-bar',
277279
'email' => 'foo.bar@example.com',
@@ -291,7 +293,9 @@ $users->addToDefaultGroup($user);
291293
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.
292294

293295
```php
296+
// Get the User Provider (UserModel by default)
294297
$users = auth()->getProvider();
298+
295299
$users->delete($user->id, true);
296300
```
297301

@@ -302,9 +306,10 @@ $users->delete($user->id, true);
302306
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.
303307

304308
```php
309+
// Get the User Provider (UserModel by default)
305310
$users = auth()->getProvider();
306-
$user = $users->findById(123);
307311

312+
$user = $users->findById(123);
308313
$user->fill([
309314
'username' => 'JoeSmith111',
310315
'email' => 'joe.smith@example.com',

0 commit comments

Comments
 (0)