By using a custom model, you can change low-level behaviour of the package, such as setting a different table name or db connection, adding custom properties, or overriding methods.
##Step 1: Create a custom model
Create a new model that extends the Spatie\LaravelOneTimePasswords\Models\OneTimePassword
model.
namespace App\Models;
use Spatie\LaravelOneTimePasswords\Models\OneTimePassword as BaseOneTimePassword;
class CustomOneTimePassword extends BaseOneTimePassword
{
}
##Step 2: Update the configuration
Next, you need to update the config/one-time-passwords.php
configuration file to use your custom model.
return [
'models' => [
'model' => App\Models\CustomOneTimePassword::class,
],
];