@extends('backend.layouts.master') @section('section-title', 'Edit Product') @section('page-title', 'Product Edit') @if (check_permission('product.update')) @section('action-button') All Product @endsection @endif @section('content')
@csrf @php $selectedBranchIds = \App\Models\BranchProduct::where('product_id', $data->id)->pluck( 'branch_id', ); @endphp {{-- Product name --}}
{{ $errors->has('name') ? $errors->first('name') : '' }}
{{-- Product barcode --}}
{{ $errors->has('barcode') ? $errors->first('barcode') : '' }}
{{-- Category --}}
{{ $errors->has('category_id') ? $errors->first('category_id') : '' }}
{{-- Brand --}}
@if ($data->unit->related_unit_id == null) {{-- Unit --}}
{{-- Unit --}}
{{-- Unit --}}
@else {{-- Unit --}}
{{-- Unit --}}
{{-- Unit --}}
@endif @if (env('APP_SC') == 'yes')
{{ $errors->has('size') ? $errors->first('size') : '' }}
{{ $errors->has('color') ? $errors->first('color') : '' }}
@endif {{-- Price --}}
{{ $errors->has('purchase_price') ? $errors->first('purchase_price') : '' }}
{{ $errors->has('selling_price') ? $errors->first('selling_price') : '' }}
{{-- status --}}
{{ $errors->has('status') ? $errors->first('status') : '' }}
{{-- Description --}}
{{-- Image --}}
@if (auth()->user()->branch_id == 1)
{{-- All Select Checkbox --}}
{{-- Branch Checkboxes --}}
@foreach ($allBranch as $branch)
id, old('branch_id', $selectedBranchIds->toArray() ?? [])) ? 'checked' : '' }}>
@endforeach
{{ $errors->has('branch_id') ? $errors->first('branch_id') : '' }}
@endif
@endsection @push('js') @endpush