php - How to declare unlimited parameters in Laravel? -


is there way declare unlimited number of parameters in routes of laravel 5 similar codeigniter?

i going build large application , declaring each , every parameter in route file each function not possible. tried searching lot didn't got solution.

you can use this

//routes.php route::get('{id}/{params?}', 'yourcontroller@action')->where('params', '(.*)'); 

remember put above on end (bottom) of routes.php file 'catch all' route, have have 'more specific' routes defined first.

//controller  class yourcontroller extends basecontroller {      public function action($id, $params = null)     {         if($params)          {             $params = explode('/', $params);             //do stuff          }     } } 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -