@extends('hms.layout') @section('title','Shift management') @section('content')

Daily duty roster, your upcoming and completed shifts, shift changes and colleague swaps. Staff leave and cover →

@if(session('success'))
{{ session('success') }}
@endif @if($errors->any())
{{ $errors->first() }}
@endif

Daily schedule

@forelse($shifts as $shift) @empty@endforelse
ShiftTimeFacilityManager on dutyAssigned staff
{{ $shift->title }}{{ \Illuminate\Support\Carbon::parse($shift->starts_at)->format('d M H:i') }} – {{ \Illuminate\Support\Carbon::parse($shift->ends_at)->format('d M H:i') }} {{ $facilities->firstWhere('id',$shift->facility_id)?->name }}{{ $staff->firstWhere('id',$shift->manager_user_id)?->name }} @foreach($assignments->get($shift->id,collect()) as $a){{ $a->name }} @if(in_array($a->user_id,$leaveAbsences))(on leave · cover needed)@endif · {{ str_replace('_',' ',$a->role) }}@endforeach
No shifts scheduled for this day.
@if($manager)

Create and publish shift

@csrf
@endif

My upcoming shifts

@forelse($my->filter(fn($s)=>\Illuminate\Support\Carbon::parse($s->ends_at)->isFuture()) as $s) @empty@endforelse
ShiftTimeManager on dutyRequest changeOffer swap / coverage
{{ $s->title }}{{ $s->starts_at }} – {{ $s->ends_at }}{{ $staff->firstWhere('id',$s->manager_user_id)?->name }} @if(\Illuminate\Support\Carbon::parse($s->starts_at)->isFuture())
@csrf
@endif
@if(\Illuminate\Support\Carbon::parse($s->starts_at)->isFuture())
@csrf
@csrf
@endif
No upcoming shifts.

Completed shifts

@forelse($my->filter(fn($s)=>\Illuminate\Support\Carbon::parse($s->ends_at)->isPast()) as $s)@empty@endforelse
ShiftStartEnd
{{ $s->title }}{{ $s->starts_at }}{{ $s->ends_at }}
No completed shifts.

Open shift swaps and coverage offers for your role

@forelse($openOffers as $offer)
{{ $offer->requester_name }} offers {{ $offer->shift_title }} · {{ $offer->starts_at }} @if($offer->type==='coverage')
@csrf
@else
@csrf
@endif
@empty

No open offers for your role.

@endforelse

{{ $manager?'Shift requests and approvals':'My requests and swap proposals' }}

@forelse($requests->filter(fn($r)=>$manager || $r->requester_id===auth()->id()) as $r)
{{ ucfirst($r->type) }} · {{ $r->requester_name }} · {{ $r->shift_title }} {{ str_replace('_',' ',$r->status) }}
@if($r->reason)
{{ $r->reason }}
@endif @if($r->type==='change')
Requested: {{ $r->requested_starts_at }} – {{ $r->requested_ends_at }}
@endif @if(in_array($r->type,['swap','coverage'],true) && $r->status==='open' && $r->requester_id===auth()->id()) @foreach($proposals->get($r->id,collect())->where('status','offered') as $p)
@csrf
@endforeach @endif @if($manager && in_array($r->status,['pending','awaiting_approval'],true))
@csrf
@endif
@empty

No requests.

@endforelse
@endsection