GuavaCZ / filament-nested-resources

MIT License
107 stars 17 forks source link

[Bug]: 404 on all nested relation pages #28

Closed mrvnklm closed 6 months ago

mrvnklm commented 7 months ago

What happened?

I get 404 error on /projects/1/tests and /projects/1/tests/create. I did everything according to the documentation and checked twice. Also the routes are listed in route:list

  GET|HEAD  app.mysite.test/projects/{record} .................................................................................................................................................................... filament.app.resources.projects.view › App\Filament\App\Resources\ProjectResource\Pages\ViewProject
  GET|HEAD  app.mysite.test/projects/{record}/tests ...................................................................................................................................................... filament.app.resources.projects.tests › App\Filament\App\Resources\ProjectResource\Pages\ManageProjectTests
  GET|HEAD  app.mysite.test/projects/{record}/tests/create ......................................................................................................................................... filament.app.resources.projects.tests.create › App\Filament\App\Resources\ProjectResource\Pages\CreateProjectTest

How to reproduce the bug

I tried the same with a different resource but the issue persists. I do not use any other traits or packages with my filament resources involved.

Package Version

1.0

PHP Version

8.2

Laravel Version

10.10

Which operating systems does with happen with?

macOS, Linux

Notes

Any ideas on how to investigate this further?

lukas-frey commented 7 months ago

@mrvnklm Hi, thanks for the bug report. Can you send me how your Project Resource and the corresponding pages look like? Thanks

EDIT: and Your Project / Test Models.

mrvnklm commented 6 months ago

I figured it out by starting over, but I really don't get what the issue was. I might need some help though: How do I register the view page in the same nested manner, maybe even with two levels deep like so:

/projects/2/tests/3 -> ViewTestsPage
/projects/2/tests/3/runs/1 -> ViewRunPage

Edit: so the link works and the breadcrumbs look fine, but the url is just

/tests/3 -> ViewTestsPage
/runs/1 -> ViewRunPage
lukas-frey commented 6 months ago

I figured it out by starting over, but I really don't get what the issue was. I might need some help though: How do I register the view page in the same nested manner, maybe even with two levels deep like so:

/projects/2/tests/3 -> ViewTestsPage
/projects/2/tests/3/runs/1 -> ViewRunPage

Edit: so the link works and the breadcrumbs look fine, but the url is just

/tests/3 -> ViewTestsPage
/runs/1 -> ViewRunPage

That's fine, the url is supposed to be like that.

If the url would include the whole "path" like projects/2/tests/3/runs/1, it would not be possible to a) support infinite amount of nested resources b) support recursive nested resource (nest same resource on itself). Which is an implication of a), since it requires infinite nesting in order to work.

mrvnklm commented 6 months ago

I see, thank you for your help!