@extends('layouts/contentLayoutMaster') @section('title', 'Add Food') @section('page-style') {{-- Page Css files --}} @endsection @section('content')
{{csrf_field()}}
@if($errors->first('name'))
Food Name Required
@enderror
@if($errors->first('local_name'))
Food Local Name Required
@enderror
@if($errors->first('category_id'))
Category Required
@enderror
@if($errors->first('tags'))
Tags Required
@enderror
@if($errors->first('sub_tag_id'))
Sub Tags Required
@enderror

@php // Example options: In a real app, pass these from your controller $effort_options = ['low' => 'Low Effort (Quick Meals)', 'medium' => 'Medium Effort', 'high' => 'High Effort (More Prep)']; // Prepare current effort values, prioritizing old input, then $food data $current_food_efforts = $food['effort'] ?? []; if (is_string($current_food_efforts)) { $current_food_efforts = json_decode($current_food_efforts, true) ?: []; } @endphp @foreach ($effort_options as $value => $label)
@endforeach @if($errors->has('effort') || $errors->has('effort.*'))
{{ $errors->first('effort') ?: $errors->first('effort.*') }}
@endif

@php // Example options: In a real app, pass these from your controller $price_options = ['budget' => 'Budget Friendly', 'moderate' => 'Moderate Cost', 'premium' => 'Premium Ingredients']; // Prepare current price values, prioritizing old input, then $food data $current_food_prices = $food['prices'] ?? []; if (is_string($current_food_prices)) { $current_food_prices = json_decode($current_food_prices, true) ?: []; } @endphp @foreach ($price_options as $value => $label)
@endforeach @if($errors->has('prices') || $errors->has('prices.*'))
{{ $errors->first('prices') ?: $errors->first('prices.*') }}
@endif
@if($errors->first('cuisine_ids') || $errors->first('cuisine_ids.*'))
Cuisine Selection Required
@enderror
@endsection @section('vendor-script') {{-- Vendor js files --}} @endsection @section('page-script') @endsection