{{-- brafa Systems — Properties list. Mirror of prototype/admin/views-properties.jsx. Livewire backing is App\Http\Livewire\SetApiKey. Every wire:* directive and property reference below is preserved verbatim — markup only changed. Properties referenced (from $this on SetApiKey): $properties (paginated, with PropertyID/PropertyName/API/dkplus_customer_id) $search, $perPage, $sortField, $sortDirection $selected_api, $apiKey, $arrivals_key $tbf_key1, $tbf_key2, $url_number $totalPropertyName, $authorizationHeaders, $totalURL $dkplus_customer_id, $dkplus_customer_name Methods referenced: sortBy(...), showPropertyDetails(...), updateApiKeys() Livewire events emitted by the component (handled in JS below): closeUpdateApiKeysModal, showSweetAlert --}} @php use Illuminate\Support\Str; use Illuminate\Support\Facades\Auth; $isSuperAdmin = Auth::check() && Auth::user()->role_id == 1; $total = $properties->total(); /* Deterministic colour for the logo tile, derived from PropertyID so a given property keeps the same colour across renders. */ $brafaTilePalette = [ '#1A1A1A', '#3A3A3A', '#5A5A5A', '#2D4A33', '#3A4D6C', '#4D3A6C', '#6C3A53', '#1E8A3E', '#8C5F1B', ]; $brafaTypeFor = function ($api) { $api = strtolower((string) $api); return match ($api) { 'golfbokanir' => ['label' => 'Golf', 'variant' => 'pill--type-golf'], 'beds24', 'godo' => ['label' => 'Hotel', 'variant' => 'pill--type-hotel'], 'bookingfactory', 'total', 'fritimi', 'guesty' => ['label' => 'Hotel', 'variant' => 'pill--type-hotel'], default => ['label' => $api ?: '—', 'variant' => 'pill--type-hotel'], }; }; @endphp
| Logo |
ID
@if ($sortField === 'PropertyID')
|
Property name
@if ($sortField === 'PropertyName')
|
Type |
API
@if ($sortField === 'API')
|
dkPlus customer | Occupancy | |
|---|---|---|---|---|---|---|---|
|
{{ $initials ?: '?' }}
{{-- onload: reveal the white plate + hide initials (so a transparent
logo never shows the initials through it). onerror: drop the img and
fall back to the coloured initials tile. --}}
|
{{ $Property->PropertyID }} |
{{ $Property->PropertyName }}
|
{{ $type['label'] }} | {{ $Property->API ?: '—' }} | {{ $Property->dkplus_customer_id ?: '—' }} |
{{-- Occupancy data is not yet on the model; render the
sunken bar at 0% as a structural placeholder. --}}
—
|
|
| No properties match your search. | |||||||