@php use App\Models\LeaveType;use App\Models\Staff;use App\Models\User; @endphp @extends('admin.layouts.app') @section('title',get_setting('site_name').' | Leave') @section('content')
Leave Application
@can('Leave-create') @endcan
@if($leaveHandoverEnabled) @endif @php $status1=null;$status2=null; @endphp @foreach($leaves as $key=>$leave) @php $staffRow = $leave->staff; $durationLabel = (float)$leave->number_of_days === 1.0 ? __('Day') : __('Days'); @endphp @if($leaveHandoverEnabled) @endif @endforeach
# Staff Name Apply Date Paid Leave From / To Duration Remarks{{ __('Handover to') }}Approval Action
{{$key+1}} @if($staffRow && $staffRow->user) {{ $staffRow->user->name }}({{ $staffRow->user_id }})-{{ optional($staffRow->warehouse)->name ?: '-' }} @else — @endif {{$leave->apply_date}} @if($leave->type=='paid') @else @endif
{{ __('From') }} {{ $leave->start }}
{{ __('To') }} {{ $leave->end }}
{{$leave->number_of_days}} {{ $durationLabel }} {{$leave->reason}}{{ $leave->handoverStaff?->selectOptionLabel() ?? '—' }} @if($leave->status==1) @elseif($leave->status==0) @else @endif @can('Leave-list') @endcan @can('Leave-edit') @endcan @can('Leave-delete') @endcan
{{$leaves->appends(request()->query())->links()}}
@endsection @section('modal') @include('modals.delete_modal') @php $leave_types_modal = LeaveType::all(); @endphp @endsection @section('script') @endsection