Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

matteo.veggiari's avatar

Laravel route multiple parameters on query string

Hello there, I'm new here. I have a route with 2 required parameters and in a case i pass these 2 parameters with 3 other optional variables. When the function builds the route i get an url where in the query string the separator & is replaced by &.

What I wrong? How can I solve this? Thank you very much

Matteo

0 likes
6 replies
matteo.veggiari's avatar

Route::get("/app_module/{app_module_id}/get_action/{action_id}", "App\Http\Controllers\GeneralController@getAppModuleAction")->name("get_action");

This is the example route('get_action', ['app_module_id'=>'myaction', 'action_id'=>'GetFile', 'par1'=>'value1', 'par2'=>'value2', 'par3'=>'value3'])

CorvS's avatar

Please always highlight code using three backticks ``` above and below your code block.

Can you post your "incorrect" URL too?

matteo.veggiari's avatar
/app_module/myaction/get_action/GetFile?par1=value1&par2=value2&par3=value3
matteo.veggiari's avatar

That was my mistake.... I've used {{ }}... I've made a simple error and you saved my day Thank you very much!

Please or to participate in this conversation.