iip muhamad ikbal
iip muhamad ikbal

Reputation: 33

pass variable url laravel

why always Sorry, the page you are looking for could not be found.

1/1 NotFoundHttpException in compiled.php line 8882:

in compiled.php line 8882 at RouteCollection->match(object(Request)) in compiled.php line 8206 at Router->findRoute(object(Request)) in compiled.php line 8134 at Router->dispatchToRoute(object(Request)) in compiled.php line 8130

and this is my route:

Route::get('/reportpeta/{filterperiode}','PetaReportController@getProvinsi');

view.blade

{{ Form::open(array('url' => url('/reportpeta/'),'method' => 'get')) }}
    ....
{{!! Form::close() !!}}

Controller

public function getProvinsi($filterperiode){
.......
}

and this is problem because calling

{{ Form::open(array('url' => url('/reportpeta/'),'method' => 'get')) }}

please tell me how to call url correctly

Upvotes: 0

Views: 55

Answers (1)

Mahmoud Gamal
Mahmoud Gamal

Reputation: 330

filterperiode is required parameter

Route::get('/reportpeta/{filterperiode}','PetaReportController@getProvinsi');

You can make it optional

Route::get('/reportpeta/{filterperiode?}','PetaReportController@getProvinsi');

Don't miss to make function parameter optional

public function getProvinsi($filterperiode = null)

According to @Ijas Ameenudeen Comment

Upvotes: 1

Related Questions