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

ekrist1's avatar

Get a url parameter blade issue

I´m trying to get url parameters from the blade view, and it works the first request, but the url parameters has a wrong format doing the second request. Any ideas why this happens?

Blade view:

<form method="get" action="/contacts/{{ Request::get('city') }}">
            <div class="input-group">
                <input type="text" name="city" id="city">
                <button type="submit">søk</button>
            </div>

First request (works): http://laravel.dev/contacts/?city=Oslo

When i´m doing the second search, I expect the query string to be Contacts/?xxx but it adds Oslo to the url, and the request fails.

--> http://laravel.dev/contacts/Oslo?city=Bergen

0 likes
1 reply
ekrist1's avatar
ekrist1
OP
Best Answer
Level 6

Fixed: ´´´

        <div class="input-group">
            <input type="text" name="city" id="city">
            <button type="submit">søk</button>
        </div>

´´´

Please or to participate in this conversation.