search

Home  >  Q&A  >  body text

Issue with not being able to send any email verification notification in Laravel 9

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粉436688931P粉436688931351 days ago394

reply all(1)I'll reply

  • P粉476547076

    P粉4765470762024-01-11 15:55:32

    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
        );
    }

    reply
    0
  • Cancelreply