@extends('layouts.master') @section('title', 'Product Add/Edit') @section('style') @endsection @section('script') @endsection @section('content') @include('layouts.sidebar') @include('layouts.header-sub') @yield('title') @php $isEdit = !empty($product->product_id); @endphp @if ($errors->any()) @foreach ($errors->all() as $error) {{ $error }} @endforeach @endif @csrf {{-- 1. Image --}} @if (!empty($product->product_image)) @endif {{-- 2. Product Code --}} Product Code {{-- 3. Product Name --}} Product Name {{-- 5. Unit --}} Unit Select Unit @foreach ($units as $unit) product_unit ?? '') == $unit->unit_id ? 'selected' : '' }}> {{ $unit->name }} @endforeach {{-- 6. Weight --}} Weight grams {{-- product_weight_unit ?? 'grams') == 'grams' ? 'selected' : '' }}> grams product_weight_unit ?? '') == 'kilogram' ? 'selected' : '' }}> kilogram --}} {{-- 7–8 Min / Max --}} Min Stock Level Max Stock Level {{-- Product Type --}} Product Type Select Product Type @foreach ($product_types as $type) product_type ?? '') == $type->product_type_id ? 'selected' : '' }}> {{ $type->product_type_name }} @endforeach {{-- Status --}} Status product_status ?? '') == 'active' ? 'selected' : '' }}> Active product_status ?? '') == 'inactive' ? 'selected' : '' }}> Inactive {{-- Description --}} Description {{ old('product_description', $product->product_description ?? '') }} Submit Back @include('layouts.footer') @endsection