@extends('layouts.app') @section('title', 'Recipes') @section('content')

Recipes

Standard recipes with ingredient quantities, yield factors and per-portion cost.
Food cost
@include('kitchen._nav')

Recipe book

{{ $recipes->count() }} recipes
@forelse($recipes as $recipe) @php($cost = $costs[$recipe->id] ?? ['total' => 0, 'per_portion' => 0]) @empty @endforelse
RecipePortionsIngredientsBatch costPer portionActions
{{ $recipe->name }}
{{ $recipe->portion_size ? (float) $recipe->portion_size . ' ' . $recipe->portion_unit . ' per portion' : '—' }}
{{ (int) $recipe->portions }} {{ $recipe->items->count() }} ingredients @if($recipe->items->count())
{{ $recipe->items->take(3)->map(fn ($line) => $items->firstWhere('id', $line->item_id)?->name)->filter()->implode(', ') }}{{ $recipe->items->count() > 3 ? '…' : '' }}
@endif
{{ money($cost['total']) }} {{ money($cost['per_portion']) }}
@csrf @method('DELETE')
@csrf

Ingredients

@foreach($recipes as $recipe)
@csrf @method('PUT')

Ingredients

@foreach($recipe->items as $index => $line)
@endforeach
@endforeach @endsection @push('styles') @endpush @push('scripts') @endpush