-
Notifications
You must be signed in to change notification settings - Fork 0
3. Routes
Ordent Official edited this page Jul 29, 2017
·
2 revisions
Here's the example to routing the url to available method
Route::get('/users', '\Ordent\RamenRest\Controllers\UserController@getCollection');
Route::get('/users/{id}', '\Ordent\RamenRest\Controllers\UserController@getItem');
Route::post('/users', '\Ordent\RamenRest\Controllers\UserController@postItem');
Route::put('/users/{id}', '\Ordent\RamenRest\Controllers\UserController@putItem');
Route::delete('/users/{id}', '\Ordent\RamenRest\Controllers\UserController@deleteItem');Dont forget you can also spoof the put and delete via POST Request with adding _method attributes that have value of either PUT or DELETE