Skip to content

Commit

Permalink
Add docs about extending the invite model
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusjunges committed Jan 28, 2024
1 parent e3341f5 commit d8db8e5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ you can use the `withoutEvents()` method:
\Junges\InviteCodes\Facades\InviteCodes::withoutEvents()->redeem('YOUR-INVITE-CODE');
```

# Extending the `Invite` model
The `\Junges\InviteCodes\Models\Invite` is fully extendable and replaceable. You can extend or create a new model to be used instead of the default one,
and the only thing you need to do is implement the `\Junges\InviteCodes\Contracts\InviteContract` interface, which contains some required methods for this package to work.

After implementing the contract, you need to change the `models.invite_model` configuration value in `config/invite-codes.php`.

# Handling invite codes exceptions

If you want to override the default `403` response, you can catch the exceptions using the laravel exception handler:
Expand Down

0 comments on commit d8db8e5

Please # to comment.