How do Laravel 5 make url with parameters?



  • We need to make a url with an uncertain number of parameters, two of which are masses. I want to make a search.

    For example:

    kino.com/{category?}/{country?}/{actors?}/{eactors?}
    

    It'll look like,

    kino.com/komedii/kanada/actors/45/154/eactors/67/99
    

    kino.com/uzhasyi

    kino.com/rossiya/eactors/56/87/34

    1. category
    2. country - country
    3. actors - actors (to be in the film) or more specifically, they're id
    4. eactors are actors (which should not be in the film) or more accurately they are id

    actors and eactors masses.

    It's easy to do on PHP through get (kino.com?category=komediicountry=kanada, etc.), but how do Laravel and PU tools do that?



  • Transmit the parameters through get, you can't make an early number of parameters through the CPD. To pass through get just don't tell the parameters when you initialize the Route.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2