I'm currently working on a quite the large website in laravel 5.2 and i want to store the choice of languages inside a route middleware, this works as expected. But when i set a route controller inside the group the controller gets two variables instead of one. The language and the second variable to the controller as shown under. Is there any way to only pass one variable to the controller instead of two?
//Routing:
Route::group(['prefix' => '{language}', 'middleware' => ['info']], function()
{
Route::get("template/{template}", 'TemplateController@getTemplate');
}
//Example method in controller:
public function getTemplate($language, $template)
{
return response($template);
}
//What i want in the controller.
public function getTemplate($template)
{
return response($template);
}