@extends('layouts.app') @section('title', 'Shift Log') @section('nav_shifts', 'bg-teal-50 text-teal-700 font-semibold') @section('page_title', 'Shift Log') @section('page_subtitle', 'History of all staff shifts') @section('content') @if(session('success'))
{{ session('success') }}
@endif {{-- Currently open shifts --}} @if($openShifts->isNotEmpty())

Currently On Shift

@foreach($openShifts as $open) {{ $open->user->name }} {{ $open->typeLabel() }} ยท since {{ $open->started_at->format('g:i A') }} @endforeach
@endif {{-- Shift history table --}}

{{ $shifts->total() }} Shifts

@if($openShifts->isEmpty()) Start Shift @else Start Shift @endif
@if($shifts->isEmpty())

No shift records yet.

@else @foreach($shifts as $shift) @endforeach
Staff Shift Started Ended Duration Status
{{ $shift->user->initials() }}

{{ $shift->user->name }}

{{ $shift->user->role?->name ?? '' }}

{{ $shift->typeLabel() }}

{{ $shift->started_at->format('M j, Y') }}

{{ $shift->started_at->format('g:i A') }}

@if($shift->ended_at)

{{ $shift->ended_at->format('M j, Y') }}

{{ $shift->ended_at->format('g:i A') }}

@else Active now @endif
{{ $shift->duration() }} @if($shift->status === 'open') Open @else Closed @endif @if($shift->status === 'open') Close @else Report @endif
@if($shifts->hasPages())
{{ $shifts->links() }}
@endif @endif
@endsection