ignaciodev's avatar

How to use $createUrlCallback ?

I have been searching online but I cannot seem to find how to use the $createUrlCallback from the VerifyEmail notification?

Thank you in advance.

0 likes
2 replies
Braunson's avatar
Braunson
Best Answer
Level 18

A quick search brings up this article. Here's some example code..

$createUrlCallback is the callback that should be used to create the verify email URL.

// In your AuthSeriviceProvider in the boot() method
VerifyEmail::createUrlUsing(function ($notifiable) {
    $verifyUrl = URL::temporarySignedRoute(
        'verification.verify',
        Carbon::now()->addMinutes(Config::get('auth.verification.expire', 60)),
        [
            'id' => $notifiable->getKey(),
            'hash' => sha1($notifiable->getEmailForVerification()),
        ]
    );

    return 'https://yourapp.com/email/verify?verify_url=' . urlencode($verifyUrl);
});
1 like

Please or to participate in this conversation.