4
您好我想在laravel路由功能中追加uri。Laravel在路由中追加URI
e.g我們有/搜索?類型=房源
//how do i can achieve this with
route('search',['type'=>'listing'])
一旦我們對搜索。我想將所有變量添加到搜索像
type=listing&query=blah blah
您好我想在laravel路由功能中追加uri。Laravel在路由中追加URI
e.g我們有/搜索?類型=房源
//how do i can achieve this with
route('search',['type'=>'listing'])
一旦我們對搜索。我想將所有變量添加到搜索像
type=listing&query=blah blah
如果你有一個名爲路線和要生成與查詢網址參數則:
route('route_name', ['param1' => 'value', 'param2' => 'value']);
在你的情況,你可以這樣做與
route('search',['type'=>'listing','subject' => ['blah'],[....]])
如果我得到你的權利,你要保存的所有查詢參數。使用Request::query()
來獲取它,然後與您的新參數合併。
route('search', array_merge(\Request::query(), ['type' => 'listing'])));