@php use App\Models\Attendance; use Carbon\Carbon; $admin = auth()->guard('web')->id(); $today = Carbon::today(); $attendance = Attendance::where('user_id', $admin) ->whereDate('presence', $today) ->whereNull('absence') ->first(); @endphp

Attendance

{{--
@if (!$attendance) @endif @if ($attendance && is_null($attendance->absence)) @endif
--}}
{{-- --}}
@if($attendances->count() > 0) @foreach ($attendances as $list) {{-- --}} {{-- --}} @endforeach @else @endif
Name Presence Presence Avance Absence Img Total Hours
{{ $list->user_id ?? '-' }}{{ $list->user->name ?? '-' }}{{ $list->user_id ?? '-' }} {{ $list->user->name ?? '-' }} {{ $list->presence ? \Carbon\Carbon::parse($list->presence)->format('l h:i A') : 'No Presence Time' }} {{ $list->absence ? \Carbon\Carbon::parse($list->absence)->format('l h:i A') : 'No Absence Time' }} @if ($list->total_work_minutes > 0) @php $hours = floor($list->total_work_minutes / 60); $minutes = $list->total_work_minutes % 60; @endphp @if ($list->total_work_minutes < 60) {{ $list->total_work_minutes }} Min @else {{ $hours }} {{ $hours == 1 ? 'Hour' : 'Hours' }} @if ($minutes > 0) {{ $minutes }} Min @endif @endif @else - @endif
Nothing in record
@if ($attendances->hasPages())
  • @foreach ($attendances->links()->elements as $element) @if (is_array($element)) @foreach ($element as $page => $url)
  • {{ $page }}
  • @endforeach @endif @endforeach
@endif