@extends('layouts.app') @section('content')

{{ $customer->code }} — {{ $customer->name }}

@can('customers.update') {{ __('common.edit') }} @endcan @can('branches.create') {{ __('customers.branch_create') }} @endcan
{{ __('common.status') }}: {{ $customer->status?->label() }}
{{ __('customers.contact_name') }}: {{ $customer->contact_name }}
{{ __('common.phone') }}: {{ $customer->phone }}
{{ __('common.email') }}: {{ $customer->email }}
{{ __('common.city') }}: {{ $customer->city }} / {{ $customer->district }}
{{ __('customers.tax_number') }}: {{ $customer->tax_number }}
{{ __('common.address') }}: {{ $customer->address }}
@if ($customer->latitude && $customer->longitude)
{{ $customer->latitude }}, {{ $customer->longitude }}
@endif @if ($customer->notes)
{{ $customer->notes }}
@endif

{{ __('customers.branches') }}

@foreach ($customer->branches as $branch) @endforeach
{{ __('common.code') }} {{ __('common.name') }} {{ __('common.city') }} {{ __('common.status') }} {{ __('common.actions') }}
{{ $branch->code }} {{ $branch->name }} {{ $branch->city }} {{ $branch->status?->label() }}
@can('branches.update') {{ __('common.edit') }} @endcan @can('branches.archive')
@csrf @method('DELETE') {{ __('common.delete') }}
@endcan @can('services.create') {{ __('services.create') }} @endcan

{{ __('customers.accounts') }}

@can('users.manage') {{ __('customers.account_create') }} @endcan
@foreach ($customer->accounts as $account) @endforeach
{{ __('common.name') }} {{ __('common.email') }} {{ __('common.status') }} {{ __('common.actions') }}
{{ $account->name }} {{ $account->email }} {{ $account->is_active ? __('common.active') : __('common.passive') }} @can('users.manage')
{{ __('common.edit') }} @if (! $account->is(auth()->user()))
@csrf @method('DELETE') {{ __('common.delete') }}
@endif
@endcan

{{ __('customers.services') }}

@foreach ($customer->services as $service) @endforeach
{{ __('services.number') }} {{ __('services.subject') }} {{ __('customers.branch') }} {{ __('common.status') }}
{{ $service->number }} {{ $service->title }} {{ $service->subCustomer?->name }} {{ $service->status?->label() }}
@can('customers.archive')
@csrf @method('DELETE') {{ __('common.delete') }}
@endcan @endsection