-
Hi, I think this will sound ridiculous to you guys, but after read the official documentation and search the internet, I just don't understand where do I put this code to send the notification. Can you help me? `$user = User::find(1); $user->notify(new TaskCompleted);` Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Did you read the Laravel docs and added the Notifiable trait to your User Model? https://laravel.com/docs/8.x/notifications#sending-notifications. The code that sends the notification must go where you want your program triggers the notification. I.e: a Controller, a Command, a Scheduled Command, etc. Also you have to define the Notification channels => https://orchid.software/en/docs/alert/#notifications-in-the-admin-panel Hope it helps. |
Beta Was this translation helpful? Give feedback.
Did you read the Laravel docs and added the Notifiable trait to your User Model? https://laravel.com/docs/8.x/notifications#sending-notifications.
The code that sends the notification must go where you want your program triggers the notification. I.e: a Controller, a Command, a Scheduled Command, etc.
Also you have to define the Notification channels => https://orchid.software/en/docs/alert/#notifications-in-the-admin-panel
Hope it helps.