October 24, 2024
Chicago 12, Melborne City, USA
PHP

Laravel – Form Input – Multiple select


<div class="col-md-6">
  <div class="form-group">
    {!! Form::label('fiscal_responsabilities_id', __('business.fiscal_responsabilities_id') . ':') !!}
    {!! Form::select('fiscal_responsabilities_id[]', $fiscales, null, [
      'class' => 'form-control',
      'multiple' => 'multiple',
      'id' => 'fiscal_responsabilities_id'
    ]) !!}
  </div>
</div>
$(document).ready(function() {
    $('#fiscal_responsabilities_id').select2();
    $('#tributes_id').select2();
});

$fiscales = FiscalResponsability::pluck('name', 'id')->toArray();

I’m using Laravel 9.

Trying to perform a multiple select, I’ve done it without the select2 script and I still haven’t been able to get the multiple selector to work correctly.



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video