F
Filamentβ€’14mo ago
Troner

Custom Page with URL parameters

I made a custom page with artisan make:filament-page but how to allow parameters like in web/routes.php where you can have somehing like this /example/{$id}. Also my page is not linked to any resource. I tried to add protected static ?string $slug = '/example/{$id}'; to my page class but then I get 404 error.
Solution:
```php //routes/web.php Route::get('/admin/example/{id}', ExamplePage::class); //ExamplePage...
Jump to solution
2 Replies
Solution
LeandroFerreira
LeandroFerreiraβ€’14mo ago
//routes/web.php
Route::get('/admin/example/{id}', ExamplePage::class);

//ExamplePage
public function mount(int $id): void
{
//...
}
//routes/web.php
Route::get('/admin/example/{id}', ExamplePage::class);

//ExamplePage
public function mount(int $id): void
{
//...
}
Troner
TronerOPβ€’14mo ago
Thanks alot! It is working πŸ˜€
Want results from more Discord servers?
Add your server