I've declared this route:
Route::get('category/{id}{query}{sortOrder}',['as'=>'sorting','uses'=>'CategoryController@searchByField'])->where(['id'=>'[0-9]+','query'=>'price|recent','sortOrder'=>'asc|desc']);
I want to get this in url: http://category/1?field=recent&order=desc How to achieve this?
if you have other parameters in url you can use;
request()->fullUrlWithQuery(["sort"=>"desc"])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With