Send multiple QueryParam with same name POST

  • Modifié il y à3 semaines 
  • Temps de lecture :1Minute

The current behavior :

/users?hobbies=handball&hobbies=volley

A Solution :

<form action="/users" method="POST">
	<select class="form-control" name="hobbies[]">
    <option value="" selected disabled>Select Users</option>
    <option value="bread">Best bread available</option>
	</select>
</form>

Will generate a URL /users?hobbies[]=bread&name

In Laravel PHP, it will automatically create an array variable.

Laisser un commentaire