@cookie The redirect works as intended. The notification also gets dispatched.
A controller looks like this for example
public function destroy(Model $model)
{
// More code...
Notification::send('Notification Title', 'Notification Text', Notification::SUCCESS);
return redirect()->route('route');
}
The helper function for sending the notification:
public static function send(string $title, string $message, string $type = self::INFO, int $duration = 7500): void
{
if (auth()->check()) {
auth()->user()->notifyNow(new BroadcastNotification($title, $message, $duration, $type));
return;
}
}
The notification just doesn't show up because of the page switch after I dispatched the notification.
A solution for this would be to notify the user and put the notification in the queue of the queue but the process of the notification being placed into the queue and processed just takes too long. (Currently I use a laravel/reverb for the websocket connection and dispatch the notification through the websocket server)