notification
Helper For Laravel Spark
The method assumes the current authenticated user, so you only need to pass the message
function notification($message)
{
$notification = app('Laravel\Spark\Contracts\Repositories\NotificationRepository');
return $notification->create(auth()->user(), $message);
}
notification([
'icon' => 'fa-users',
'body' => "Hello World",
'action_text' => 'Click Me',
'action_url' => "http://google.com",
]);
+1 for wondering where you put it.