F
Filamentβ€’15mo ago
Veur

How to create a sub-resource

Hi, I'm trying to create a sub-resource for one of my resources. The parent resource is WebsiteResource and the sub-resource is PageResource. The WebsiteResource is accessible from /websites. I want the sub-resource to be accessible through /websites/1/pages (for the list of pages) and /websites/1/pages/1 (for the view of Page:1). I tried to accomplish this with the code below in the sub-resource, but it's giving me a Illuminate\Routing\Exceptions\UrlGenerationException (missing parameter):
public static function getPages(): array
{
return [
'index' => Pages\ListPages::route('/{website}'),
'view' => Pages\ViewPage::route('/{website}/{record}'),
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListPages::route('/{website}'),
'view' => Pages\ViewPage::route('/{website}/{record}'),
];
}
1 Reply
Veur
VeurOPβ€’15mo ago
Update: when I disable breadcrumbs for the whole panel (->breadcrumbs(false)), it all works fine... but I would like to keep the breadcrumbs πŸ™‚
Want results from more Discord servers?
Add your server