Pages · Laravilt
Nested Resources
Create child resources under parent resources
Nested resources allow you to scope child resources under a parent resource, creating hierarchical URL structures.
Creating a Nested Resource
bash
Parent Resource
php
Nested Resource
php
URL Structure
With nested resources, URLs follow this pattern:
text
Accessing Parent Record
php
Properties
| Property | Type | Description |
|---|---|---|
$parentResource | string | Parent resource class |
$parentRelationship | string | Eloquent relationship name |
$shouldRegisterNavigation | bool | Usually false for nested |