@extends('layouts.app') @section('title', $product->exists ? 'Edit Product' : 'New Product') @php $restaurantDepartmentId = $departments->firstWhere('slug', 'restaurant')?->id; $barDepartmentId = $departments->firstWhere('slug', 'bar')?->id; $restaurantSections = $sections->where('type', 'restaurant')->values(); $barSections = $sections->where('type', 'bar')->values(); $restaurantCategories = $categories->where('department_id', $restaurantDepartmentId)->values(); $barCategories = $categories->where('department_id', $barDepartmentId)->values(); @endphp @section('content')

{{ $product->exists ? 'Edit product' : 'New Product' }}

Choose the department first. Restaurant and Bar are separate departments, and each can have many sections.

@csrf @if ($product->exists) @method('PUT') @endif
{{ \App\Models\Department::nameFor('restaurant', 'Restaurant') }}: menu item — enter selling price only; stock, buying cost and reorder control come from ingredients/recipes.
{{ \App\Models\Department::nameFor('bar', 'Bar') }}: stocked product — enter buying price, selling price and opening quantity.

Optional.

{{-- Keep separate native selects instead of