Is it possible to create a route that accepts many types of variables with them being optional or in random order? I know I can set a pattern per id, name etc.
Or do I need to build a method for each situation and try/catch this exception? NotFoundHttpException
For example
Route::get('/get/id={any}/{name?}/{rf_id}',function($id, $name = null,$rf_id){
// return $segment = Request::segment(2);
return $id.$name.$rf_id;
});
Route::get('view/{template}', 'EngineController@view')->where('template', '.+');
Then on EngineController@view i will receive all the string after "view/"
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community