我是一条laravel路线
Route::get('/find/mobiles','SearchController@byCategory');
我希望从路径文件中向byCategory
方法发送值,例如$category='mobile' or $category = 'television'
我无法找到任何办法。
答案 0 :(得分:0)
路线:
Route::get('find/{category}, 'SearchController@byCategory');
控制器:
Public function byCategory($category){
... $category is whatever is passed from the route ...
}