@extends('layouts.customer') @section('title', __('Affiliate')) @section('page-title', __('Affiliate')) @section('content')
@if($affiliate) @php $referralUrl = url('/?ref=' . $affiliate->code); @endphp
{{ __('Referral link') }}: {{ $referralUrl }}
@endif
@if(!$affiliate)
{{ __('You do not have an affiliate profile yet.') }}
@csrf {{ __('Become an Affiliate') }}
@else @php $selectedRange = $range ?? 'today'; @endphp
{{ __('Last Year') }} {{ __('Last Month') }} {{ __('Last Week') }} {{ __('Today') }}
{{ __('Active Referrals') }}
{{ number_format((int) $activeReferrals) }}
{{ __('All time') }}
{{ __('Commission Revenue') }}
{{ number_format((float) $commissionRevenue, 2) }}
{{ __('All time') }}
{{ __('Upcoming Payout') }}
{{ number_format((float) $upcomingPayoutAmount, 2) }}
{{ __('Unpaid commissions') }}
@forelse($recentReferrals as $ref)
{{ $ref->referredCustomer?->full_name ?? __('Visitor') }}
{{ $ref->referred_at ? $ref->referred_at->format('Y-m-d') : optional($ref->created_at)->format('Y-m-d') }}
{{ $ref->referred_customer_id ? __('Signed up') : __('Visited') }}
@empty
{{ __('No referrals yet.') }}
@endforelse
@endif
@endsection @push('scripts') @endpush