© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•16mo ago•
1 reply
Gauthier EHOLOUM

Optional path param for custom page

Hi everyone! I'm having trouble with a Filament page. I defined the {course?} parameter as optional in my route:
GET|HEAD   admin/courses/{course?}/manage
GET|HEAD   admin/courses/{course?}/manage

However, when I access the page without passing an ID, I get a 404 error. My mount method looks like this:
public function mount(?Course $course): void
{
    $this->course = $course;
}
public function mount(?Course $course): void
{
    $this->course = $course;
}

Is there something I'm missing to make the route work without the course parameter?
Thanks for your help!
optional-route-param.png
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

Custom route with path parameters for custom page
FilamentFFilament / ❓┊help
3y ago
Custom page layout for custom pages
FilamentFFilament / ❓┊help
3y ago
Validation for custom page
FilamentFFilament / ❓┊help
2y ago
Navigation for custom page
FilamentFFilament / ❓┊help
2y ago