Skip to content

Commit

Permalink
Update readme usage block
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Oct 7, 2020
1 parent caf26af commit bccaa51
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ class ArchivablePost extends Model {
}
```

The extensions shipped with this trait include; `archive`, `unArchive`, `WithArchived`, `withoutArchived`, `onlyArchived` and can be used accordingly:

```php
$user = User::first();
$user->archive();
$user->unArchive();

$usersWithArchived = User::query()->withArchived();
$onlyArchivedUsers = User::query()->onlyArchived();
```

By default, the global scope of this trait uses the `withoutArchived` extension when the trait is added to a model.

### Testing

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
Expand Down

0 comments on commit bccaa51

Please sign in to comment.