@php $branch_id = Auth::user()->branchId; $softwareDate = DB::table('gnr_branch') ->where('id', $branch_id) ->where('status', 1) ->orderBy('id', 'ASC') ->first(); if ($softwareDate) { $year = (int) date('Y', strtotime($softwareDate->branchOpeningDate)); // $year = (int) date('Y', strtotime($softwareDate->softwareStartDate)); } else { $year = 2015; } $name = $id = 'fillYear'; $label = isset($element['label']) ? $element['label'] : 'Year:'; $show_all = isset($element['showAll']) ? $element['showAll'] : 'no'; $class = 'form-control'; if (isset($element['attributes']['class'])) { $class .= ' ' . $element['attributes']['class']; } $attributes = ['id' => $id, 'class' => $class, 'placeholder' => 'Select year']; if (isset($element['attributes'])) { $attributes = array_merge($attributes, $element['attributes']); } $options = $yearsOption = array_combine(range(date('Y') + 1, $year), range(date('Y') + 1, $year)); //$options = $yearsOption = range(date("Y"), 2016); if (isset($element['options'])) { if ($show_all == 'yes') { $options = ['0' => 'All'] + $element['options']; } else { $options = $element['options']; } } else { if ($show_all == 'yes') { $options = ['0' => 'All'] + $options; } else { $options = $options; } } $defaultValue = isset($element['defaultValue']) ? $element['defaultValue'] : ''; $col = isset($element['col']) ? 'col-xs-' . $element['col'] : 'col-xs-2'; @endphp