F
Filamentβ€’16mo ago
BKF Dev

Custom page url

Hi there ! I'm trying to set a parameter in a custom page url (see attached), but I'm getting an error : Missing required parameter for [Route: filament.pages.{$id}/feature] [URI: admin/{$id}/feature] [Missing parameter: $id]. What am I missing ?
15 Replies
Unknown User
Unknown Userβ€’16mo ago
Message Not Public
Sign In & Join Server To View
BKF Dev
BKF Devβ€’16mo ago
Thanks & not working
krekas
krekasβ€’16mo ago
i think you should set route in method
Dan Harrin
Dan Harrinβ€’16mo ago
$id is not the correct syntax inside route names should be {id}
BKF Dev
BKF Devβ€’16mo ago
Oh yes !! loool you're right DAN /D Thanks hhh
Dan Harrin
Dan Harrinβ€’16mo ago
you cant call php logic from inside a property definition
BKF Dev
BKF Devβ€’16mo ago
But wait, it still not working with the same error :/ !!!! @Dan Harrin squint
Dan Harrin
Dan Harrinβ€’16mo ago
this shouldnt be in the sidebar should it? so you $shouldRegisterNavigation = false
BKF Dev
BKF Devβ€’16mo ago
Even true or false, same error !
Dan Harrin
Dan Harrinβ€’16mo ago
where is the url being generated because it needs to pass in the id parameter
BKF Dev
BKF Devβ€’16mo ago
I've set a static value as example, look the image above id=1
Dan Harrin
Dan Harrinβ€’16mo ago
that doesnt matter not how laravel routes work it is not an optional parameter you may as well not have the parameter at all if youre not going to pass it in
BKF Dev
BKF Devβ€’16mo ago
I fixed it thanks, protected static ?string $slug = '{id?}/feature'; πŸ‘ πŸ™‚
Dan Harrin
Dan Harrinβ€’16mo ago
i dont understand the point but ok
BKF Dev
BKF Devβ€’16mo ago
hhh as you said, I forgot to set it optional πŸ˜‚
Want results from more Discord servers?
Add your server
More Posts