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

PetroGromovo's avatar

How to make get request with additive parameters?

In Lumen 8 project I want to add additive parameters to get request, something like: $router->group(['prefix'=>'api/v1'], function() use($router){

  $router->get('pages/{filter_published?}/{filter_is_homepage?}', 'PageController@index');

and having in the control:

class PageController extends Controller
{
    public function index($filter_published= '', $filter_is_homepage= '')
    {
        ...

But I failed to set postman request, as setting Query Params GET request I got different type of url : https://imgur.com/a/J3JSr5I How to made it to have valid get request with additive parameters ?

Thank you in advance!

0 likes
1 reply
CorvS's avatar
CorvS
Best Answer
Level 27

If I understand you correctly, you want filter_published and filter_is_homepage to be query parameters instead of route parameters? Then your route is incorrect, you can remove the route parameters and simply use

$router->get('pages', 'PageController@index');

and

public function index(Request $request)
{
    $published = $request->input('filter_published');
    $isHomepage = $request->input('filter_is_homepage');
    ...
}
1 like

Please or to participate in this conversation.