© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•12mo ago•
32 replies
Randak

Action to redirect from one panel to another

My Admin Panel lists a User's current nebula_instances. When I click on a specific nebula_instance I want to redirect to the game panel and retain the nebula_instance_id. I've tried many ways (some versions in Pastebin commented out), but can't get it to work. My current error when clicking a nebula_instance is:
foreach() argument must be of type array|object, string given

Any guidance, direction, an open source project that does this, would be appreciated. I am a coding novice. Thanks.

Pastebin for the full files:
https://pastebin.com/W5fsJXic#hJGUz6WJ

Some select file info that hopefully provides the answer:

Standard panels (no dashboard):
Admin
Game

From the NebulaInstanceResource:
            ->actions([
                    Action::make('viewGame')
                        ->label('Enter Game')
                        ->icon('heroicon-o-play')
//                        ->action(function (NebulaInstance $record) {
//                            session(['nebula_instance_id' => $record->id]);
//                            return redirect('/game');
//                        }),

                        ->url('/game')
                        //->url(fn (NebulaInstance $record) => url('/game?nebula_instance_id=' . $record->id))
                        ->openUrlInNewTab()
            ])
            ->actions([
                    Action::make('viewGame')
                        ->label('Enter Game')
                        ->icon('heroicon-o-play')
//                        ->action(function (NebulaInstance $record) {
//                            session(['nebula_instance_id' => $record->id]);
//                            return redirect('/game');
//                        }),

                        ->url('/game')
                        //->url(fn (NebulaInstance $record) => url('/game?nebula_instance_id=' . $record->id))
                        ->openUrlInNewTab()
            ])
Pastebin
Action to redirect from one panel to another - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
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

Change a filament resource from one panel to another
FilamentFFilament / ❓┊help
3y ago
Panel redirect
FilamentFFilament / ❓┊help
3y ago
Open an action from another action
FilamentFFilament / ❓┊help
3y ago
How to trigger an action from another action?
FilamentFFilament / ❓┊help
14mo ago