stylers/laravel-email-change is a Laravel package for model can change own email and verify it.
It currently has 0 GitHub stars and 0 downloads on Packagist (latest version 0.2.0).
Install it with composer require stylers/laravel-email-change.
Discover more Laravel packages by stylers
or browse all Laravel packages to compare alternatives.
Last updated
composer require stylers/laravel-email-change
php artisan vendor:publish --provider="Stylers\EmailVerification\Frameworks\Laravel\ServiceProvider"
php artisan migrate
use Illuminate\Database\Eloquent\Model;
use Stylers\EmailVerification\NotifiableInterface;
use Illuminate\Notifications\Notifiable;
use Stylers\EmailVerification\EmailVerifiableInterface;
use Stylers\EmailVerification\Frameworks\Laravel\Models\Traits\EmailVerifiable;
use Stylers\EmailChange\Contracts\EmailChangeableInterface;
use Stylers\EmailChange\Models\Traits\EmailChangeable;
class User extends Model implements NotifiableInterface, EmailVerifiableInterface, EmailChangeableInterface
{
use Notifiable;
use EmailVerifiable;
use EmailChangeable;
...
public function getName(): string
{
return (string)$this->name;
}
}
$emailChangeableUser = User::first();
$changeRequestInstance = $emailChangeableUser->createEmailChangeRequest($newEmail);
This package requires Laravel Email Verification package and the ChangeEmail listener handle it's VerificationSuccess event. If you want to finish change request, you have to implement email-verification route. Read more: https://github.com/stylers-llc/laravel-email-verification#example-of-verification