How to have Resource with custom route parameters?

Lets say I have Menus -> Categories relationship where one Menu has many Categories. I would love to limit a list of Categories to a specific Menu based on the parameter in the URL.


class CategoryResource extends Resource
{
    protected static ?string $model = Category::class;

    protected static bool $shouldRegisterNavigation = false;

    protected static ?string $slug = 'menus/{menu}/categories';


I am getting Missing parameter: menu error when trying to access resource via /admin/menus/1/categories url.

I do believe my additional route parameter gets missing from the getUrl generation for all other actions on the table.

Please advice.
Was this page helpful?