@extends('layouts.app') @section('title', 'Menus') @section('content') @php use App\Models\KitchenCycleMenu; $money = fn ($v) => \App\Support\Fmt::money($v); $day = fn ($v) => \App\Support\Fmt::day($v instanceof \DateTimeInterface ? $v->format('Y-m-d') : $v); $sel = 'h-9 w-full rounded-lg border border-input bg-transparent px-3 text-sm outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50'; $plannedTotal = $rows->sum('cost'); $statusCls = [ 'Planned' => 'bg-sky-500/15 text-sky-700', 'Stamped' => 'bg-slate-500/15 text-slate-600', 'Unscheduled' => 'bg-amber-500/15 text-amber-700', ]; @endphp

Cycle menus stamped onto dates with headcount-driven planned cost

Menus

CSV
@include('partials.flashes')
@forelse ($menus as $m) {{ $m->name }} {{ $m->cycle_length }}-day cycle · {{ $m->totalHeadcount() }} covers @empty

No cycle menus yet.

@endforelse
@if ($active)
{{ $active->cycle_length }} Days in cycle
{{ $rows->count() }} Dishes planned
{{ $stampRanges }} Stamp ranges
{{ $money($plannedTotal) }} Planned cost per cycle

{{ $active->name }} — cycle plan

@csrf @method('DELETE')
@csrf @method('DELETE')
@forelse ($rows as $row) @empty @endforelse
Day Meal Dish Headcount From Planned cost Status Actions
Day {{ $row['day'] }} {{ $row['meal'] }} {{ $row['recipe']?->name ?? '—' }} @if ($row['recipe']) {{ $money($row['recipe']->costPerPortion()) }}/portion @endif {{ $row['headcount'] }} {{ $row['date'] ? $day($row['date']) : '—' }} {{ $money($row['cost']) }} {{ $row['status'] }}
@csrf @method('DELETE')
No dishes in this cycle yet.

Add a dish to the cycle

@csrf

Lunch covers boarders, day scholars and staff; other meals cover boarders and staff only.

Stamp the cycle onto dates

@csrf
@if ($active->stampRanges->isNotEmpty())

Current stamp ranges

@foreach ($active->stampRanges as $range)
{{ $day($range->range_from) }} → {{ $day($range->range_to) }} {{ count($range->dates()) }} date(s){{ $range->skip_weekends ? ', weekends skipped' : '' }}
@endforeach
@endif
@else
Create a cycle menu to start planning dishes.
@endif
@endsection