Go back and add three backticks ` before and after the code blocks.
One thing I notice is that if you use resource controllers, you don't need additional routes for create and edit.
Hi everyone,
I'm still working on my first Laravel app - it's a reptile tracker app. Anyways I'm still trying to understand the best way of doing RESTful routes, below are my current routes:
// Weight routes...
Route::resource('weights', 'WeightController');
Route::get('weights/{gecko_name}/create', 'WeightController@create');
// Gecko routes...
Route::get('geckos', 'GeckoController@index');
Route::resource('gecko', 'GeckoController');
Route::get('gecko/{gecko_name}/view', 'GeckoController@show');
Route::get('gecko/{gecko_name}/edit', 'GeckoController@edit');
So to give you an idea, a couple of the routes could be:
app.dev/gecko/Zilly/view
app.dev/gecko/Zilly/update
app.dev/weights/Zilly/create
And I want to implement some image uploads, so I'm thinking the following routes:
app.dev/gecko/Zilly/images
app.dev/gecko/Zilly/images/upload
app.dev/gecko/Zilly/images/delete
Have I got my endpoints correct? Does the way I'm doing things make sense or could I make them better/more understandable?
I appreciate any help with this stuff,
Andy
Please or to participate in this conversation.