ekrist1
1095
1
General

Get a url parameter blade issue

Posted 2 years ago by ekrist1

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

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.