Support the ongoing development of Laravel.io →
Input Eloquent Forms
Last updated 2 years ago.
0

Should someone else come across this, the answer is "nested resources". In my case, I solved it by doing this:

Route::resource('clients.contacts', 'ContactsController', array('except' => array('create', 'index', 'show')));

A simple php artisan routes-call reveals that the routes created for the ContactsController should contain two parameters in the url, one client id and one contact id (where applicable). Handling contacts is now a cinch in the controller and can be done in the proper RESTful way.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

fredrkr fredrkr Joined 11 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.