@extends('layouts.app') @section('title', $client->exists ? $client->name : __('New company file')) @section('page-title', $client->exists ? $client->name : __('New company file')) @section('page-subtitle', $client->exists ? __('Edit the company profile.') : __('Create a new company profile.')) @php // Country config as a JS-friendly map. The form reactively updates the // registration field label/hint, VAT format and legal form options when // the operator switches country. $countryJson = json_encode($countries, JSON_UNESCAPED_UNICODE); $action = $client->exists ? route('tenant.clients.update', $client) : route('tenant.clients.store'); $method = $client->exists ? 'PATCH' : 'POST'; $isCreate = ! $client->exists; $skipped = session('import_skipped', []); @endphp @section('content')
{{ __('Back') }} @if($isCreate) {{-- Tab switcher: Single entry vs Bulk import. Visible only on create. --}}
@endif
@if(session('error'))
{{ session('error') }}
@endif @if(! empty($skipped) && $isCreate)
@foreach($skipped as $row)
{{ __('Row :n', ['n' => $row['row']]) }} — {{ $row['name'] ?: __('(empty)') }}
    @foreach($row['errors'] as $e)
  • {{ $e }}
  • @endforeach
@endforeach
@endif @if($errors->any())
@foreach($errors->all() as $e)
{{ $e }}
@endforeach
@endif {{-- ─── SINGLE ENTRY TAB ─────────────────────────────────────────── --}}
@csrf @if($method === 'PATCH') @method('PATCH') @endif {{-- 2-column grid on lg+ to fill the wider container. The sections are ordered so the left column holds the legal/identity data (sticky to the country picker that drives the adaptive labels) and the right column holds the address + contact + notes. --}}
{{-- Identity --}}

{{ __('Identity') }}

{{ __('Who is this company?') }}

{{-- Country + national IDs (country-adaptive) --}}

{{ __('Country & official identifiers') }}

{{ __('The fields below adapt to the selected country.') }}

{{-- Address --}}

{{ __('Address') }}

{{-- Contact --}}

{{ __('Contact') }}

{{-- Notes --}}
{{ __('Cancel') }}
{{-- ─── BULK IMPORT TAB ──────────────────────────────────────────── --}} @if($isCreate)
{{-- Upload form (2/3 wide) --}}
@csrf

{{ __('Upload your file') }}

{{ __('CSV or Excel (.xlsx). Max 5 MB. First row must be the column headers.') }}

{{ __('Each row will be validated against the same rules as the single form. Invalid rows are skipped — the rest are imported.') }}
{{-- How-it-works sidebar (1/3 wide) --}}
@endif
@endsection