© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
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
WebsiteResource
and the sub-resource is
PageResource
PageResource
.

The
WebsiteResource
WebsiteResource
is accessible from
/websites
/websites
. I want the sub-resource to be accessible through
/websites/1/pages
/websites/1/pages
(for the list of pages) and
/websites/1/pages/1
/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
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}'),
    ];
}
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

How to create a resource record from another resource?
FilamentFFilament / ❓┊help
3y ago
How to create a cluster without sub navigation UI in the resource page?
FilamentFFilament / ❓┊help
11mo ago
How to create resource specific to a panel?
FilamentFFilament / ❓┊help
3y ago
Resource sub-navigation in a modal
FilamentFFilament / ❓┊help
3y ago