You can use the built-in Laravel feature to handle email verification.
First, you need to add the email_verified_at column to your users table. You can do this by running the following command:
php artisan make:migration add_email_verified_at_column_to_users_table --table=users
Then, in the up() method of the migration, add the following code:
Schema::table('users', function (Blueprint $table) {
$table->timestamp('email_verified_at')->nullable();
});
Next, you need to add the MustVerifyEmail trait to your User model.
use Illuminate\Contracts\Auth\MustVerifyEmail;
class User extends Authenticatable implements MustVerifyEmail
{
// ...
}
Finally, you need to add the VerifyEmail middleware to your routes.
Route::get('/home', 'HomeController@index')->middleware('verified');
Now, when a user registers, they will receive an email with a verification link. When they click the link, the email_verified_at column will be updated with the current timestamp.