How can I redirect on notifications action?

Notification::make()
->title('Saved successfully')
->success()
->body('Changes to the post have been saved.')
->actions([
\Filament\Notifications\Actions\Action::make('view')
->button()
->action($this->redirect(TestResource::getUrl('edit', ['record' => $this->record->id]))),
])
->sendToDatabase($recipient);
Notification::make()
->title('Saved successfully')
->success()
->body('Changes to the post have been saved.')
->actions([
\Filament\Notifications\Actions\Action::make('view')
->button()
->action($this->redirect(TestResource::getUrl('edit', ['record' => $this->record->id]))),
])
->sendToDatabase($recipient);
I currently have this but when i press the the View button nothing happens. This tells me that the default behavior doesnt allow for redirects. Is this at all possible to do?
5 Replies
DarkKnight
DarkKnight6mo ago
Hmm Im still having trouble with that
DarkKnight
DarkKnight6mo ago
No description
Thijmen
Thijmen6mo ago
That is some laravel problem
DarkKnight
DarkKnight6mo ago
Okk, thanks for the help fixed