Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Spatie Laravel Welcome Notification

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?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading