Просто передайте параметры, не определенные в маршруте.
// We define a route with the param 'param1'
Route::get('something/{param1}/asdf', 'Controller@action')->name('something');
// This is what happens when we pass the defined parameter
route('something', ['param1' => 1]) // yields: 'something/1/asdf
route('something', ['param1' => 'a_string']) // yields: 'something/a_string/asdf
// This is what happens when we pass other parameters we didn't define
route('something', ['param1' => 1, 'param2' => 2]) // yields: 'something/1/asdf?param2=2
route('something', ['param1' => 'a_string', 'param2' => 'qwer']) // yields: 'something/a_string/asdf?param2=qwer
Итак, для вашего примера:
Route::get('api')->name('api.example');
# and then
route('api.example', ['example' => 1, 'ex2' => 2]); // yields '/api?example=1&ex2=2'