@extends('layouts.app') @section('title', 'Start Shift') @section('nav_shifts', 'bg-teal-50 text-teal-700 font-semibold') @section('page_title', 'Start Your Shift') @section('page_subtitle', 'Clock in to begin tracking your shift activity') @section('content') @if(session('error'))
{{ session('error') }}
@endif
{{-- ===== BLOCKED STATE — another shift is still open ===== --}} @if(isset($activeShift) && $activeShift)

Shift Already Active

You cannot start a new shift until the current one is closed.

Open Shift

{{ $activeShift->user->initials() }}

{{ $activeShift->user->name }}

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

{{ $activeShift->typeLabel() }} shift · started {{ $activeShift->started_at->format('g:i A') }} · {{ $activeShift->started_at->diffForHumans() }}

Active

Ask {{ $activeShift->user->name }} to close their shift and submit the handover report. Once that shift is closed, you'll be able to clock in.

@can('shifts.manage') @endcan
View shift history
{{-- ===== NORMAL START FORM ===== --}} @else {{-- Handover notes from previous shift --}} @if($lastShift)

Handover from {{ $lastShift->user->name }}

{{ $lastShift->typeLabel() }} shift · ended {{ $lastShift->ended_at->diffForHumans() }}

{{ $lastShift->handover_notes }}

@endif {{-- Start shift form --}}

Clock In

{{ now()->format('l, F j, Y · g:i A') }}

@csrf {{-- Shift type --}}
@foreach([ 'morning' => ['Morning', '6:00 AM – 2:00 PM', 'M-D'], 'afternoon' => ['Afternoon', '2:00 PM – 10:00 PM', 'A'], 'night' => ['Night', '10:00 PM – 6:00 AM', 'N'], 'custom' => ['Custom', 'Any hours', 'C'], ] as $val => [$label, $hours, $abbr]) @endforeach
@error('shift_type')

{{ $message }}

@enderror
{{-- Opening cash float --}}

Enter the cash float you received at the start of this shift

View shift history
@endif {{-- end @else (no blocking shift) --}}
@endsection