3

I got a form in laravel with Method='GET'

{{ Form::open(array('method' => 'get')) }}

I got a few input fields in there: city, skillLevel, province and category. When i submit the form i get a awfull url like this:

http://localhost/vacatures?city=somehwhere&skillLevel=junior&province=Zeeland&category=django

but i want something like this:

http://localhost/vacatures/somewhere/junior/Zeeland/django

How do i achieve this? I've tried giving at a route attribute and a action actribute, but that didnt work out.

3
  • 2
    I am afraid that is how html works. You can look into stackoverflow.com/questions/5464481/clean-urls-for-search-query and matthewjamestaylor.com/blog/… They are both basically hacks so I am guessing there is no standard way to go about this. Commented Feb 8, 2015 at 16:35
  • Well, if i would to stick with the ugly url, how can i use a Route that catches this? Commented Feb 8, 2015 at 16:37
  • Wouldn't it be available to the vacatures controller by default ? Commented Feb 8, 2015 at 16:44

1 Answer 1

5

Maybe this topic will help you - How To Pass GET Parameters To Laravel From With GET Method ?

There are 2 nice answers, which should suit to your problem.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! Did not come across this answer yet!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.