In Laravel 5.4, I have an edit form with multiple select option as below code:
Problem: After the form is submitted, all options (bot from database and manually selected) are deselect.
Form validation:
$validator = Validator::make($request->all(), [
'id' => 'required',
"location.*" => 'required|string|distinct|min:1',
]);
Question 1: How can I keep the old input of this multiple select option in the edit form work?
Question 2: How can I store the form value as array into the database?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire