In my View I have:
<select multiple="multiple" name="carga_mental[]" class="form-control select2">
@foreach($cadastros->where('key', 'carga_mental') as $carga_mental)
<option value="{{ $carga_mental->title }}"> {{ $carga_mental->title }} </option>
@endforeach
</select>
In my Controller I have:
$this->repository->update($request->all(), $id);
When I submit the form it returns this error:
Array to string conversion (SQL: update
relatorio_setores
setcarga_mental
= Comfortable Conditions, whereid
= 4)
And it only takes the first selected item.
My intention is to write the selected items to the table in JSON format, how can I do this?