@php
try{
$allowedLeaves = $pendingLeave->user->leaveTypes->sum('no_of_leaves');
$leavesRemaining = ($allowedLeaves-$pendingLeave->leaves_taken_count);
$percentLeavesRemaining = ($leavesRemaining/$allowedLeaves) * 100;
}
catch (Exception $e){
$percentLeavesRemaining = 0;
}
@endphp
{{ $pendingLeave->leave_date->format($global->date_format) }} ({{ $pendingLeave->leave_date->format('l') }})
{{ $percentLeavesRemaining }}% Complete
{{ ($leavesRemaining) }} @lang('modules.leaves.remainingLeaves')