Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

nested resources laravel

Sometimes you may need to define routes to a nested resource. 
For example, a photo resource may have multiple comments that may be
attached to the photo. To nest the resource controllers, 
you may use "dot" notation in your route declaration:

Route::resource('photos.comments', PhotoCommentController::class);
//return Route :
/photos/{photo}/comments/{comment}
 
PREVIOUS NEXT
Tagged: #nested #resources #laravel
ADD COMMENT
Topic
Name
6+7 =