Created
October 8, 2016 07:58
-
-
Save shaneturner/9d9980a7c8ecb6328b35aed0335fd2de to your computer and use it in GitHub Desktop.
Resourceful routing and controller example. With nested relationships.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Route::resource('foo', 'FooController'); | |
// Specific methods for the relation between models | |
Route::resource('foo.bar', 'Foo\BarController'); // For accessing Bar related with Foo | |
Route::resource('foo.bar.bez', 'Foo\Bar\BezController'); // For accessing Bez related with Foo and Bar | |
Route::resource('foo.bar.bez.biz', 'Foo\Bar\Bez\BizController'); // For accessing Biz related with Foo, Bar and Bez | |
// General methods for each collection/resource | |
Route::resource('bar', 'BarController'); // For accessing bar | |
Route::resource('bez', 'BezController'); // For accessing bez | |
Route::resource('biz', 'BizController'); // For accessing biz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment