2

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.

Kevinvhengst
  • 1,672
  • 4
  • 27
  • 40
  • 2
    I am afraid that is how html works. You can look into http://stackoverflow.com/questions/5464481/clean-urls-for-search-query and http://matthewjamestaylor.com/blog/how-to-post-forms-to-clean-rewritten-urls They are both basically hacks so I am guessing there is no standard way to go about this. – Noman Ur Rehman Feb 08 '15 at 16:35
  • Well, if i would to stick with the ugly url, how can i use a Route that catches this? – Kevinvhengst Feb 08 '15 at 16:37
  • Wouldn't it be available to the vacatures controller by default ? – Noman Ur Rehman Feb 08 '15 at 16:44

1 Answers1

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.

Community
  • 1
  • 1
Xyrus
  • 908
  • 10
  • 13