Install OTPz for Laravel
mainTo install OTPz, use Composer to require the package, publish the migrations, and run them. You must then update your User model to implement the Otpable interface and use the HasOtps trait.
composer require benbjurstrom/otpz
php artisan vendor:publish --tag="otpz-migrations"
php artisan migrate// app/Models/User.php
namespace App\Models;
use BenBjurstrom\Otpz\Models\Concerns\HasOtps;
use BenBjurstrom\Otpz\Models\Concerns\Otpable;
// ...
class User extends Authenticatable implements Otpable
{
use HasFactory, Notifiable, HasOtps;
// ...
}