FilamentF
Filament5mo ago
keiron

Redirect to List after Edit - Global setting?

Hi, the default behaviour after editing a resource is to stay on that resource's page. Is it possible to make a global change to redirect on edit to the List view?
Solution
Starting with Filament v4, there is a global configuration option for this:

use Filament\Panel;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->resourceCreatePageRedirect('index') // or
        ->resourceCreatePageRedirect('view') // or
        ->resourceCreatePageRedirect('edit');
}


https://filamentphp.com/docs/4.x/resources/creating-records#customizing-redirects
Was this page helpful?