Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mstdmstd's avatar

Where have I to define email for UrlGenerator?

In my lumen 8.0 app I want to add Resets Passwords functionality reading https://stackoverflow.com/questions/37338015/trying-to-reset-passwords-in-lumen article but I got error :

: Route [password.reset] not defined. at /mnt/_work_sdb8/wwwroot/LumenProjects/PublishPagesAPI/vendor/laravel/lumen-framework/src/Routing/UrlGenerator.php:231)

and checking related code I see in Notifications/ResetPassword.php:

public function toMail($notifiable)
{
    \Log::info(  varDump($notifiable, ' -1 $notifiable::') );
    \Log::info(  varDump(static::$toMailCallback, ' -2 static::$toMailCallback::') );
    if (static::$toMailCallback) {
        return call_user_func(static::$toMailCallback, $notifiable, $this->token);
    }

    \Log::info(  varDump(static::$createUrlCallback, ' -3 static::$createUrlCallback::') );
    if (static::$createUrlCallback) {
        $url = call_user_func(static::$createUrlCallback, $notifiable, $this->token);
    } else {

        $url = url(route('password.reset', [
            'token' => $this->token,
            'email' => $notifiable->getEmailForPasswordReset(),
        ], false));
    }

    return $this->buildMailMessage($url);
}

and checking log I see :

[2021-07-01 13:35:04] local.INFO: NULL : -2 static::$toMailCallback:: : NULL  
[2021-07-01 13:35:04] local.INFO: NULL : -3 static::$createUrlCallback:: : NULL 

Looks like in some config file I have to set these variables? Could you please point where and which parameters?

Also as this article was written for lumex 5, if Notifications good decision for lumen 8?

Thanks!

0 likes
0 replies

Please or to participate in this conversation.