From d8db8e57420954825d00d0a7ecb2a6d553618b98 Mon Sep 17 00:00:00 2001 From: Mateus Junges Date: Sun, 28 Jan 2024 15:26:53 -0300 Subject: [PATCH] Add docs about extending the invite model --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 892912b..892a75c 100644 --- a/README.md +++ b/README.md @@ -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: