@php use App\Models\KitchenRecipe; $editing = $recipe !== null; $action = $editing ? route('kitchen.recipes.update', $recipe) : route('kitchen.recipes.store'); $method = $editing ? 'PUT' : 'POST'; $sel = $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'; $ings = $editing ? $recipe->ingredients : collect(); $comp = $editing ? $recipe->composed->pluck('id')->all() : []; @endphp
@csrf @method($method)

Ingredients *

@forelse ($ings as $ing) @empty @endforelse
Item Qty per batch Unit Yield %

Composed recipes (optional)

@foreach ($allRecipes as $ar) @if (!$editing || $ar->id !== $recipe->id) @endif @endforeach @if (($allRecipes->count() <= 1) && !$allRecipes->firstWhere('id', $editing ? $recipe->id : null))

No other recipes yet to compose from.

@endif

Composed sub-recipes inherit their ingredient cost; ingredient list is additive.

Cancel
@once @push('scripts') @endpush @endonce