How To Pass GET Parameters To Laravel From With GET Method ?

后端 未结 7 905
余生分开走
余生分开走 2020-11-30 02:05

i\'m stuck at this very basic form, that i could not accomplish, which i want to build a search form with an text input, and two select controls, with a route that accept 3

7条回答
  •  死守一世寂寞
    2020-11-30 02:30

    So you're trying to get the search term and category into the URL?

    I would advise against this as you'll have to deal with multi-word search terms etc, and could end up with all manner of unpleasantness with disallowed characters.

    I would suggest POSTing the data, sanitising it and then returning a results page.

    Laravel routing is not designed to accept GET requests from forms, it is designed to use URL segments as get parameters, and built around that idea.

提交回复
热议问题