有人在嘗試使用 Spatie 配置歡迎通知時遇到此問題嗎
我沒有任何 WelcomeNotification 模型。我需要做一個嗎?
uj5u.com熱心網友回復:
我想您已經在模型檔案夾中創建了一個通知,因為您使用的是$user->notify(new WelcomeNotification($validUntil))
. 而且,您將 WelcomeNotification 模型作為引數而不是通知類物件傳遞給 notify,這會導致錯誤。
您需要在app/Notifications
. 因此,當您運行此命令時,它將自動在app/Notifications
檔案夾中創建 WelcomeNotification。
php artisan make:notification WelcomeNotification
現在,匯入use App\Notifications\WelcomeNotification;
User 模型。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/520820.html
標籤:拉拉维尔