Pass Parameters to Index Page on Panel
Hi Team.
I tried to pass some extra parameters on route to index page for PanelBuilder but I have issues.
Do you have any idea to solve this issue?
13 Replies
This is for V3 Filament.
You have to pass a record to it, it doesn’t read the url directly. ::route(‘/{id}, [‘id’ => $record->id]
Same as using the route() helper in laravel.
hey bro i have a doubt like i want to show the viewpage of a perticular record so i do this but it doesn't work it shows [Missing parameter: record].
auth()->user()
is probably still undefined as this is processed before middlewares are run.ok if i pass like this
i just want to show the view page of the login user in the this resource index page only the view
I'd create a new page and manually set the record in
mount()
i create a custom view page and use the mount to add the record manually this is the error and inside the custom view page
in the resource
I guess you also need to overwrite the
getNavigationItems()
method (or similar name) so you can pass the record to the route. Otherwise Filament doesn’t know which record it needs to pass i just got one solution here like this and then in the view page a just set the record from auth()->id()
Thank you so much @AliBabba420 ...
Is it work for you
yeah, perfectly, since yesterday trying to find a solution...
public static function getPages(): array
{
return [
'edit' => Pages\EditTeam::route('/{record}/edit'),
'index' => Pages\EditTeam::route("/settings/edit"),
];
}
Mark it as a solution