{{ ($recipe->exists ? "Edit {$recipe->name}" : 'Add Recipe') }}

@if ($recipe->exists)@method('put')@endif @csrf

Ingredients

@for($i = 0; $i < 20; $i++) @php if (isset($recipe->foodAmounts[$i])) { $foodAmount = $recipe->foodAmounts[$i]; $amount = \App\Support\Number::fractionStringFromFloat($foodAmount->amount); $unit = $foodAmount->unit; $food_id = $foodAmount->food->id; $food_name = $foodAmount->food->name; $detail = $foodAmount->detail; } else { $foodAmount = new \App\Models\FoodAmount(); $amount = $food_id = $food_name = $unit = $detail = null; } @endphp
@endfor

Steps

@php($step_number = 0)
@foreach($recipe->steps as $step)
{{ $step_number++ }}
@endforeach Add Step
{{ ($recipe->exists ? 'Save' : 'Add') }}