Laravel 5.5 - 从多选框中检索所有选定的值[重复]

This question already has an answer here:

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>

Change name="customer" to name="customer[]"

This will pass values of <select> as array.