Issues with nested resources (maybe)
Hi everyone, has anyone encountered issues with nested resources? I set up a resource for a model called PersonnelProfile and nested a resource for the Contract model within it. The resulting URL looked something like mydomain.com/personnel-profiles/2/contracts/create, but I got a 'file not found' error. However, as a test, I created a model named Profile and nested the contract there, which worked correctly. Could I be making a mistake by naming it PersonnelProfile in the first place? Maybe the hyphens in the url or something else?
3 Replies
What was the specific "file not found" error?
Hi!! I tried with another model called JobProfile, where I attempted to nest the Phone resource, but the error was the same—it correctly shows the index, but the create action returns a 404 Not Found. On the other hand, the one I created without hyphens in the url, named Profile, allowed me to properly nest the Contract
resource.


Also, I used a Relation Page to access the nested resource:
php artisan make:filament-page ManageJobProfilePhones --resource=JobProfiles\JobProfileResource
--type=ManageRelatedRecords
These are my getPage and getRecordSubNavigation functions in my JobProfileResource: