Multi-select using Laravel Collective
Wed May 04 2022 09:12:47 GMT+0000 (Coordinated Universal Time)
Saved by
@eneki
// CONTROLLER
$selectedShareEntities = ShareHolder::where('client_id', $clientId)->get()->pluck('entity_id');
return view('shares.shareholders.show', [
'selectedShareEntities' => $selectedShareEntities
]);
// BLADE
<div class="">
<label class="required-field">Share Entity</label>
{!! Form::select('entity_id[]', $shareEntities, $selectedShareEntities, ['id' => 'shareEntities', 'multiple' => 'multiple']) !!}
</div>
content_copyCOPY
Comments