Using Belltastic Classes
If you don't want to use Laravel Notifications, you can simply call Belltastic\Notification::create()
to send a new notification from any place in your code:
// creates and sends a new notification
\Belltastic\Notification::create($project_id, $user_id, [
// [required|string]
// title of the notification, displayed in bolder text
'title' => 'New comment on your post "Laravel Basics"',
// [nullable|string]
// body of the notification, smaller text
'body' => 'Joe Belltastic has left a comment on your post. Click here to see more.',
// [nullable|string]
// link to an icon/avatar to display next to notification
'icon' => null,
// [nullable|string]
// link to visit when the user clicks a notification
'action_url' => 'https://example-blog.com/posts/1234?comments',
// [nullable|string]
// category of the notification, used for segments in the future
'category' => 'comments',
]);
You can read more about it on the Library Reference page.