F
Filament3w ago
Xavi

Listener on verification

How can I create a listener for when the user has verified the email. The idea is that once verified, I create the subscription in cashier
1 Reply
Julien B. (aka yebor974)
Hi. You have the default event from laravel Illuminate\Auth\Events\Verified. Just create an event listener for this event and add your process in handle methode. Example :
namespace App\Listeners;

use Illuminate\Auth\Events\Verified;

class TestEmailVerifiedListener
{
public function __construct()
{
}

public function handle(Verified $event): void
{
dd($event);
}
}
namespace App\Listeners;

use Illuminate\Auth\Events\Verified;

class TestEmailVerifiedListener
{
public function __construct()
{
}

public function handle(Verified $event): void
{
dd($event);
}
}
For listener, look at this documentation : https://laravel.com/docs/11.x/events#defining-listeners
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.

Did you find this page helpful?