@if(NULL!=$leave_application && NULL != $leave_application->attachment) @php $eachfl = $leave_application->attachment; $ext = explode('.', $eachfl); $extCount = count($ext); $lastIndex = $extCount-1; if('xls'== $ext[$lastIndex] || 'xlsx'== $ext[$lastIndex] || 'csv'== $ext[$lastIndex] || 'xls'== $ext[$lastIndex]){ $bg_style = 'success'; $bg_type = 'excel'; }else if('pdf'== $ext[$lastIndex]){ $bg_style = 'danger'; $bg_type = 'pdf'; }else if('doc'== $ext[$lastIndex] || 'docx'== $ext[$lastIndex]){ $bg_style = 'info'; $bg_type = 'word'; }else if('txt'== $ext[$lastIndex]){ $bg_style = ''; $bg_type = 'text'; }else if('png'== $ext[$lastIndex] || 'jpeg'== $ext[$lastIndex] || 'jpg'== $ext[$lastIndex]){ $bg_style = ''; $bg_type = 'image'; }else{ $bg_style = ''; $bg_type = ''; } @endphp
@else
{{trans('messages.no_data')}}
@endif