@extends('layouts.admin') @section('title', 'Customers') @section('admin-content') @include('admin.partials.player-tabs', ['activeTab' => 'players'])
@if($search)Clear@endif
@forelse($players as $player)@empty@endforelse
CustomerReceipt claimsConfirmed rewardsTotal spinsIP addressesEmail accessActions
{{ $player->name }}{{ $player->email }}{{ $player->email_verified_at ? 'Email verified' : 'Email not verified' }}{{ $player->claims_count }} claims ↗{{ $player->pending_claims }} pending review{{ $player->confirmed_rewards }}{{ $player->spins_count }}{{ $player->last_ip ?: 'Not recorded yet' }}Registered: {{ $player->registration_ip ?: 'Not recorded yet' }}@if($player->last_ip && $activeIPs->contains($player->last_ip))Last IP is blocked@endifManage IP rules ↗@php($emailBlock = $emailBlocks->get($player->email))
@if($emailBlock?->active)
@csrf @method('PUT')
@else@endif @php($blockIp = $player->last_ip ?: $player->registration_ip) @if($blockIp && !$activeIPs->contains($blockIp))@elseif($blockIp)IP is blocked@else@endif
{{ $search ? 'No customers match your search.' : 'No customers yet. Customers appear here after verifying their email during receipt submission.' }}
@foreach($players as $player)

Customer details

{{ $player->name }}Customer #{{ $player->id }}Joined {{ $player->created_at->format('d M Y') }} · {{ $player->email_verified_at ? 'Email verified' : 'Email not verified' }}
{{ $player->claims_count }}Receipt claims
{{ $player->confirmed_rewards }}Confirmed rewards
{{ $player->spins_count }}Total spins
@if((int) old('editing_player') === $player->id && $errors->any())@endif @php($customerProfile = \Illuminate\Support\Facades\DB::table('customer_profiles')->where('user_id', $player->id)->first()) @php($customAnswers = \Illuminate\Support\Facades\DB::table('customer_form_answers')->where('user_id',$player->id)->orderByDesc('id')->get()) @if($customAnswers->isNotEmpty())
Additional form answers@foreach($customAnswers as $answer)

{{ $answer->label }}: {{ $answer->value }} ({{ $answer->created_at }})

@endforeach
@endif @if($customerProfile)
Contact & preferences
@foreach(['Mobile'=>$customerProfile->mobile ?: 'Not provided','Cat name'=>$customerProfile->cat_name ?: 'Not provided','Number of cats'=>$customerProfile->cat_count ?? 'Not provided','Source'=>$customerProfile->source ?: 'Not provided','Email offers'=>$customerProfile->marketing_email ? 'Opted in' : 'Not opted in','WhatsApp/SMS offers'=>$customerProfile->marketing_mobile ? 'Opted in' : 'Not opted in','Interests'=>implode(', ', json_decode($customerProfile->interests ?: '[]', true) ?: []) ?: 'Not provided'] as $label=>$value)
{{ $label }}
{{ $value }}
@endforeach
@endif
Recent receipt claims
@forelse(\Illuminate\Support\Facades\DB::table('receipt_submissions')->where('user_id',$player->id)->latest('id')->limit(10)->get() as $claim)@empty@endforelse
ReceiptStatusSubmitted
{{ $claim->receipt }}{{ $claim->branch }}{{ $claim->status==='pending'?'Pending verification':ucfirst($claim->status) }}{{ $claim->created_at }}
No receipt claims yet.
Manage this customer’s claims ↗
Recent wheel results@forelse(\Illuminate\Support\Facades\DB::table('spins')->where('user_id',$player->id)->latest('id')->limit(10)->get() as $result)

{{ $result->prize_name }} · {{ $result->reward_status==='pending'?'Pending verification':ucfirst($result->reward_status) }} · {{ $result->created_at }}

@empty

No spins yet.

@endforelse
Access information
Last IP address
{{ $player->last_ip ?: 'Not recorded' }}
Registration IP address
{{ $player->registration_ip ?: 'Not recorded' }}

Account settings

@csrf @method('PUT')

Customers sign in using an email verification code. A changed email must be verified again.

@endforeach

Block customer access

@csrf
@endsection @push('scripts') @endpush