<div class="form-group" id="projectsByBranchContainer{{ $branch->id }}">
    <label for="name">{{ trans('messages.Projects') }} - {{ $branch->name }}
    </label>
    <div id="project_id_container_{{ $branch->id }}">
        {!! Form::select(
            'projects[' . $branch->id . '][]',
            $projects,
            [0],
            [
                'class' => 'form-control select2',
                'style' => 'width:100%',
                'id' => 'project_id_' . $branch->id,
                'multiple' => 'multiple',
                'required' => 'required',
                'data-placeholder' => trans('messages.Branch'),
            ],
        ) !!}
    </div>
</div>

<script type="text/javascript">
    $('#project_id_' + '{{ $branch->id }}' + ' option').filter('[value=0]').prop('selected', true);
    $('.select2').select2();
</script>
