page with id route laravel code example Example: laravel route optional parameter Route::get('/sample/{param?}', 'SampleController@index');