I'm using the following code to generate a link:
{{ URL::route('monthly',array($year,$month_number)) }}
Which looks like
/monthly?1999&5
But what I really need is:
/monthly/1999/5
How should I accomplish this?
You have to create a route to support those parameters:
Route::get('montly/{year}/{month_number}', 'ControllerName@show');
And your controller method:
public function show($year, $month_number)
{
...
}
Route::get('monthly/{year}/{month} ...Route::get('monthly/{year}/{month_number}')as the 2nd argumentparamsshould be applied into the constructor. Something else is going on here.