@extends('layouts.master') @section('title', 'Customer 360 - ' . $customer->full_name) @section('content')
{{ strtoupper(substr($customer->first_name ?? 'C', 0, 1)) }}

{{ $customer->first_name }} {{ $customer->last_name }}

{{ $customer->job ?? 'No Job Title' }}

{{ $customer->card->card_no ?? 'No Card Assigned' }}
@csrf
  • Mobile {{ $customer->card->mobile_number ?? 'N/A' }}
  • Status @if(($customer->card->status ?? '') == 'active') Active @else Inactive @endif
  • Province/City {{ $customer->card->province->province_name_en ?? 'N/A' }}
Devices
@csrf
{{ $customer->card->devices->count() }}
    @forelse($customer->card->devices as $device)
  • {{ $device->device_model ?? 'Unknown Device' }}
    Last active: {{ $device->updated_at ? $device->updated_at->diffForHumans() : 'Never' }}
    Token: {{ substr($device->device_token, 0, 10) }}...
    @if($device->is_active)
    @csrf
    @else Unlinked @endif
  • @empty
  • No devices linked.
  • @endforelse
Current Subscription
@php // Get latest subscription from the controller-passed collection $latestSub = $subscriptions->first(); @endphp @if($latestSub)

{{ $latestSub->package->pkg_name_en ?? 'Unknown Package' }}

Valid until: {{ $latestSub->subscription_ends_at ? \Carbon\Carbon::parse($latestSub->subscription_ends_at)->format('d M, Y') : 'N/A' }}

Subscribed: {{ $latestSub->subscription_starts_at ? \Carbon\Carbon::parse($latestSub->subscription_starts_at)->format('d M, Y') : 'N/A' }}

@php $isActive = $latestSub->is_active || $latestSub->subscription_status === 'active'; $isFuture = $latestSub->subscription_ends_at === null || $latestSub->subscription_ends_at >= now(); @endphp @if($isActive && $isFuture) Active @elseif(!$isActive) Inactive @else Expired @endif
Paid: {{ number_format($latestSub->amount_paid, 2) }} EGP
@else
No subscription history found.
@endif
Transaction History
Found: {{ $debugCount ?? 0 }} records View All
@forelse($recentTransactions as $txn) @empty @endforelse
Date Brand Original Disc. Paid Status Actions
{{ $txn->created_at ? \Carbon\Carbon::parse($txn->created_at)->format('d M Y, H:i') : 'N/A' }}
{{ $txn->brand->brand_name_en ?? 'Unknown Brand' }}
{{ number_format($txn->transaction_value ?? 0, 2) }} {{ number_format($txn->discount_percentage ?? 0, 1) }}% {{ number_format($txn->amount_to_be_paid ?? 0, 2) }} @if($txn->status == 'approved') Approved @elseif($txn->status == 'rejected') Rejected @else Pending @endif @if($txn->status == 'approved')
@csrf
@endif @if($txn->status == 'waiting')
@csrf
@endif @if($txn->status == 'pending')
@csrf
@endif @if($txn->status == 'refunded') Refunded via Support @endif

No transactions recorded.

@endsection