Home > OS >  Spatie Laravel Welcome Notification
Spatie Laravel Welcome Notification

Time:10-25

did someone encounter this problem when trying to configure the welcome notification using Spatie

enter image description here

I don't have any WelcomeNotification Model. do i need to make one?

CodePudding user response:

I suppose you have created a notification in the model folder because you are using $user->notify(new WelcomeNotification($validUntil)). And, you are passing WelcomeNotification model into notify as a parameter instead of a notification class object, which causes error.

You need to create the notification in the app/Notifications. So, when you run this command it will automatically create the WelcomeNotification in the app/Notifications folder.

php artisan make:notification WelcomeNotification

Now, import use App\Notifications\WelcomeNotification; in the User model.

  • Related