@props([ 'index' => ':index', 'recipe' => [], 'ingredients' => [], 'template' => empty($recipe) ? 'data-template-' : '', ]) @php /** * @var App\Models\Product $ingredient */ @endphp
class(['form-control inputmask-numeric', 'is-invalid' => $errors->has("recipes.$index.quantity")]) }} {{ $template }}id="{{ "input-recipe-quantity{$index}" }}" {{ $template }}name="{{ "recipes[$index][quantity]" }}" value="{{ $recipe['quantity'] ?? 1 }}" data-index="{{ $index }}" />
@if($errors->has("recipes.$index.quantity")) @error("recipes.$index.quantity")
{{ $message }}
@enderror @endif