Skip to content

Notification action URL does not markAsRead with SPA mode on #19433

@omegion

Description

@omegion

Package

filament/filament

Package Version

v5.3.1

Laravel Version

v12.53

Livewire Version

No response

PHP Version

8.4

Problem description

Hi,

When SPA mode is on, notifications with action does not mark the notification read and does not close the notification sidebar.

            \Filament\Notifications\Notification::make()
                ->success()
                ->title($this->event->workspace->name . ' created')
                ->body('<b>' . $this->event->workspace->user()->first()->name . '</b> created a workspace')
                ->actions([
                    Action::make('view')
                        ->url(route(ViewWorkspace::getRouteName(), ['tenant' => $this->event->workspace->team()->first(), 'record' => $this->event->workspace]))
                        ->button()
                        ->size(Size::ExtraSmall)
                        ->markAsRead(),
                ])
                ->getDatabaseMessage();
return $panel
            ->spa(hasPrefetching: true);

Expected behavior

It should close notification sidebar and mark it as read.

Steps to reproduce

Enable SPA mode and create notification with action + URL

Reproduction repository (issue will be closed if this is not valid)

https://github.com/omegion/filament-cpa-notif

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions