@extends('layouts/contentLayoutMaster') @section('title', 'Add Food') @section('page-style') {{-- Page Css files --}} @endsection @section('content') {{csrf_field()}} Food Name @if($errors->first('name')) Food Name Required @enderror Food Local Name @if($errors->first('local_name')) Food Local Name Required @enderror Categories Select @foreach($categories as $c) id) ? 'selected': '' }}>{{ $c->name }} @endforeach @if($errors->first('category_id')) Category Required @enderror Tags Select @foreach($tags as $t) id) ? 'selected': '' }}>{{ $t->name }} @endforeach @if($errors->first('tags')) Tags Required @enderror SubTags Select @foreach($sub_tags as $t) id) ? 'selected': '' }}>{{ $t->name }} @endforeach @if($errors->first('sub_tag_id')) Sub Tags Required @enderror Effort @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) {{ $label }} @endforeach @if($errors->has('effort') || $errors->has('effort.*')) {{ $errors->first('effort') ?: $errors->first('effort.*') }} @endif Price Tier @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) {{ $label }} @endforeach @if($errors->has('prices') || $errors->has('prices.*')) {{ $errors->first('prices') ?: $errors->first('prices.*') }} @endif Select Primary Food Ingredients new Select @foreach($ingredients as $ing) id,$selected_primary_ingredient))? 'selected':'' }} > {{ $ing->name }} @endforeach Select Food Ingredients Select @foreach($ingredients as $ing) id,$selected_ingredient))? 'selected':'' }} > {{ $ing->name }} @endforeach Select Cuisine @php $selected_cuisines = $food['cuisine_ids'] ?? []; @endphp @foreach($cuisines as $cui) id, old('cuisine_ids', $selected_cuisines ?? []))) ? 'selected' : '' }}> {{ $cui->name }} @endforeach @if($errors->first('cuisine_ids') || $errors->first('cuisine_ids.*')) Cuisine Selection Required @enderror Details {{ $food['details'] }} Local Details {{ $food['local_details'] }} Submit @endsection @section('vendor-script') {{-- Vendor js files --}} @endsection @section('page-script') @endsection