@extends('admin.layout') @section('title', 'Kelola Shift') @section('content')

💡 Info: Shift menentukan jam kerja karyawan. Setiap user bisa memiliki lebih dari 1 shift dengan periode waktu berbeda.

@forelse($shifts as $shift) @empty @endforelse
ID Nama Shift Jam Mulai Jam Selesai Durasi Total User Aksi
{{ $shift->id }} {{ $shift->name }} @php $hour = intval(substr($shift->start_time, 0, 2)); if ($hour >= 5 && $hour < 12) { $icon = '🌅'; } elseif ($hour >= 12 && $hour < 17) { $icon = '☀️'; } elseif ($hour >= 17 && $hour < 21) { $icon = '🌆'; } else { $icon = '🌙'; } @endphp {{ $icon }} {{ substr($shift->start_time, 0, 5) }} {{ substr($shift->end_time, 0, 5) }} @php $start = \Carbon\Carbon::parse($shift->start_time); $end = \Carbon\Carbon::parse($shift->end_time); if ($end->lessThan($start)) { $end->addDay(); } $duration = $start->diffInHours($end, false); @endphp {{ $duration }} jam {{ $shift->users()->count() }} user Edit
@csrf @method('DELETE')
Belum ada shift
Silakan tambahkan shift baru untuk mengatur jam kerja karyawan
@if($shifts->hasPages()) @endif @endsection