Skip to content

Commit bccaa51

Browse files
author
=
committed
Update readme usage block
1 parent caf26af commit bccaa51

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ class ArchivablePost extends Model {
3434
}
3535
```
3636

37+
The extensions shipped with this trait include; `archive`, `unArchive`, `WithArchived`, `withoutArchived`, `onlyArchived` and can be used accordingly:
38+
39+
```php
40+
$user = User::first();
41+
$user->archive();
42+
$user->unArchive();
43+
44+
$usersWithArchived = User::query()->withArchived();
45+
$onlyArchivedUsers = User::query()->onlyArchived();
46+
```
47+
48+
By default, the global scope of this trait uses the `withoutArchived` extension when the trait is added to a model.
49+
3750
### Testing
3851

3952
Currently, a test suite doesn't exist for this package. However, I will be writing tests in line with Laravel's testing schemes for traits. If you wish to contribute any unit tests of your own, please refer to the [contribution guides](#-contributing) below

0 commit comments

Comments
 (0)