If you want to have a URL, for example http://myapp/users/{param1}/{param2} you need to have the following in your controller:
Route::get('users/{param1}/{param2}', ' UserController@getIndex ');
and access it:
class UserController extends BaseController { public function getIndex($param1, $param2) {
but hey, you can also do something like this, the routes will be the same:
class UserController extends BaseController { public function getIndex() { $param1 = Input::get('param1'); $param2 = Input::get('param2'); } }
but your url will look something like this: http://myapp/users?param1=value¶m2=value
source share