Issue with not being able to send any email verification notification in Laravel 9
P粉436688931
P粉436688931 2024-01-10 17:27:50
0
1
388

Throughout the project I tried a lot of things to figure out why I couldn't send the confirmation email :) After all my attempts I realized that my attribute prefix (us_email) was not allowed and I had to change it Written as "email". Even tried overriding the getEmailForVerification function but it didn't work

public function getEmailForVerification(): string
{
    return $this->us_email;
}

Is there a way to use the "us_" prefix as my email attribute name and send email verification notifications?

P粉436688931
P粉436688931

reply all(1)
P粉476547076

WooooW, I found the solution I used "Accessors and Modifiers". It looks like there is an alias set for my us_email field

public function email(): Attribute
{
    return Attribute::make(
        get: fn($email) => $this->us_email,
        set: fn($email) => $this->us_email = $email
    );
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template