@extends('backend.layouts.master') @section('section-title', 'Edit Service') @section('page-title', 'Service Edit') @if (check_permission('service.index')) @section('action-button') All Service @endsection @endif @section('content')
@csrf @method('put') @php $selectedBranchIds = \App\Models\BranchProduct::where('product_id', $data->id)->pluck( 'branch_id', ); @endphp {{-- Service name --}}
{{ $errors->has('name') ? $errors->first('name') : '' }}
{{-- Service barcode --}}
{{ $errors->has('barcode') ? $errors->first('barcode') : '' }}
{{ $errors->has('selling_price') ? $errors->first('selling_price') : '' }}
{{-- status --}}
{{ ($errors->has('status'))?$errors->first('status'):''; }}
{{-- Description --}}
@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