@extends('layouts.master') @php $isEdit = isset($customer); $action = $isEdit ? route('customers.update', $customer) : route('customers.store'); $method = $isEdit ? 'PUT' : 'POST'; @endphp @section('title', $isEdit ? 'تعديل عميل' : 'إضافة عميل') @section('pages') {{ __('dashboard.home') }} @endsection @section('content')
@if ($errors->any())
@endif
@csrf @if ($isEdit) @method('PUT') @endif
{{ $isEdit ? 'تعديل عميل' : 'إضافة عميل' }}
رجوع
@if ($userBranchId && $userBranch) {{-- 🔹 المستخدم له فرع ثابت --}}
🔸 الفرع الحالي : {{ is_array($userBranch->name) ? $userBranch->name[app()->getLocale()] ?? ($userBranch->name['en'] ?? '') : (method_exists($userBranch, 'getTranslation') ? $userBranch->getTranslation('name', app()->getLocale()) : $userBranch->name) }} ({{ $userBranch->branch_code }})
@else {{-- 🔹 المستخدم ليس له فرع → يظهر له الاختيار --}}
@endif
{{--
الكود يثبت عند الحفظ، ويُولَّد تسلسليًا لكل فرع.
--}}
@endsection @section('js') @endsection