簡體   English   中英

我無法在 laravel 9 中發送任何 email 驗證通知

[英]i can't send any email verification notification in laravel 9

我在整個項目中嘗試了很多東西來弄清楚為什么我不能發送確認 email :) 在我的整個旅程之后,我意識到我的屬性前綴 (us_email) 是不允許的,我必須把它寫成“電子郵件”。 甚至試圖覆蓋getEmailForVerification function,但它不起作用

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

有沒有辦法使用這個“us_”前綴作為我的 email 屬性名稱並發送 email 驗證通知?

WooooW,我找到了我使用“Accessors & Mutators”的解決方案。 看起來我為我的 us_email 字段設置了別名

public function email(): Attribute
{
    return Attribute::make(
        get: fn($email) => $this->us_email,
        set: fn($email) => $this->us_email = $email
    );
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM