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",
]);
How about accepting a second argument for an optional user id? In my case, I would like to notify the team owner when the billing is updated (per user team billing)