This question already has an answer here:
- HTML input arrays 4 answers
I have a multi-select box that's populated via JavaScript. After submitting a post request, it appears it only stores one value despite multiple selections. How can I retrieve all selections from a multi-select box in Laravel 5.5 after a post request?
[View]
<div class="form-group mx-sm-1">
<select id="customer" name="customer" type="form-control" class="form-control" multiple></select>
</div>
[Controller]
public function showResults(Request $request){
$field = Request::input('customer');
// dd("Reached POST with:", $field);
$results = $this->performQuery($field);
return view('filter', compact('results'));
}
</div>