© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
19 replies
Eric

Redirect after bulk action

is this how u would redirect after a bulk action is completed?
Tables\Actions\BulkAction::make('create_playlist')
    ->action(function (Collection $records) {
        $playlist = Playlist::create([
            'name' => null,
        ]);

        $playlist->songs()->attach($records);

        return to_route('filament.admin.resources.playlists.edit', $playlist);
    })
    ->icon('heroicon-o-plus')
    ->color(Color::Indigo)
,
Tables\Actions\BulkAction::make('create_playlist')
    ->action(function (Collection $records) {
        $playlist = Playlist::create([
            'name' => null,
        ]);

        $playlist->songs()->attach($records);

        return to_route('filament.admin.resources.playlists.edit', $playlist);
    })
    ->icon('heroicon-o-plus')
    ->color(Color::Indigo)
,


i tried to use
$this->to_route()
$this->to_route()
but im not in an object context

i prefer
$this->to_route()
$this->to_route()
since is the livewire one. the
return to_route()
return to_route()
is the laravel one. and the diference is that the filament notifications/livewire stuff glitches a little bit, just a little, before redirecting. instead, the livewire one doesnt do it ^^
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Redirect with ->url() with bulk action?
FilamentFFilament / ❓┊help
2y ago
Redirect after custom action
FilamentFFilament / ❓┊help
2y ago
Redirect after import action
FilamentFFilament / ❓┊help
3y ago
Bulk action error after updating
FilamentFFilament / ❓┊help
11mo ago