In order to add parameter to a GET method, I know that I have to add {parameter}
in the route like the following
Route::get('example/search/{id}', 'ExampleController@exampleMethod')
However, is there a way to do this using the RESTful controller like the following?
routes.php
Route::controller('example', 'ExampleController')
ExampleController.php
public function getSearch($id){
//do something with $id
}
The above doesn't work because the routes.php
doesn't expect a parameter to getSearch
method. I wonder if there is a way to solve this without having to add individual Route::get
routes.