@php $name = $id = 'fillShiftId'; $label = isset($element['label']) ? $element['label'].'*' : 'Shift:'; $class = 'form-control custom-select2'; if (isset($element['attributes']['class'])) { $class .= ' ' . $element['attributes']['class']; } $attributes = ['id' => $id, 'class' => $class,'placeholder' => 'Please select shift']; if (isset($element['attributes'])) { $attributes = array_merge($attributes, $element['attributes']); } $data = []; $data = DB::table('eims_shift') ->selectRaw("id,CONCAT(name, ' (', DATE_FORMAT(start_time, '%h:%i %p'), '-', DATE_FORMAT(end_time, '%h:%i %p'), ')') as name") ->whereNull('deleted_at') ->where('status',1) ->orderBy('name', 'asc') ->pluck('name', 'id'); $options = $data; if (isset($element['options'])) { $options = $element['options']; } $defaultValue = isset($element['defaultValue']) ? $element['defaultValue'] : ''; @endphp