@extends('dashboard.layouts.app') @section('content') @include('components.alert') @php $selectedPeriodLabel = \Carbon\Carbon::create()->month((int) $month)->year((int) $year)->format('F Y'); @endphp
Back to List
Influencer
{{ $influencer->name }}
{{ $influencer->phone }} | {{ $influencer->email }} @if ($influencer->user) | Linked User: {{ $influencer->user->name }} @endif
{{ $influencer->promocodes->count() }} Linked Promocode(s)
Commission Filter

Filter monthly invoice usages and commission reports.

{{ $selectedPeriodLabel }}
Linked Promo Codes
{{ $influencer->promocodes->count() }}
Total Usages (All Time)
{{ $totalInvoicesAllTime }}
Total Earnings (All Time)
{{ number_format($totalEarningsAllTime, 2) }} EGP
Earnings ({{ $selectedPeriodLabel }})
{{ number_format($totalEarningsFiltered, 2) }} EGP
{{-- Promocodes List --}}
Linked Promocodes Configuration

List of promocodes registered under this influencer and their commission settings.

@forelse ($influencer->promocodes as $promocode) @php $expireDate = $promocode->expire_date ? \Carbon\Carbon::parse($promocode->expire_date) : null; $isExpired = $expireDate ? $expireDate->isPast() : false; $discountLabel = $promocode->type === 'percentage' ? number_format($promocode->discount, 0) . '%' : number_format($promocode->discount, 0); @endphp {{ $promocode->code }} {{ $discountLabel }} {{ $promocode->limit }} @if ($expireDate) {{ $expireDate->format('d M Y') }} @else — @endif {{ ucfirst($promocode->commission_type ?? '—') }} {{ $promocode->commission_type === 'percentage' ? number_format($promocode->commission_amount, 0) . '%' : number_format($promocode->commission_amount, 2) . ' EGP' }} {{ $promocode->student_invoices_count }} {{ number_format($promocode->total_earnings, 2) }} EGP @empty
No promocodes linked to this influencer.

Edit or create a promocode and select this influencer.

@endforelse
{{-- Related Invoices --}}
Usage History & Invoices

Invoices that used this influencer's promocodes during {{ $selectedPeriodLabel }}.

{{ $totalInvoicesFiltered }} Invoice(s)
@forelse ($filteredInvoices as $invoice) {{ $loop->iteration }} {{ $invoice->invoice_number }}
{{ trim(($invoice->student->first_name ?? '') . ' ' . ($invoice->student->last_name ?? '')) ?: '—' }}
{{ $invoice->promocode->code ?? '—' }} {{ number_format($invoice->net_price, 2) }} EGP +{{ number_format($invoice->calculated_commission, 2) }} EGP {{ \Carbon\Carbon::parse($invoice->created_at)->format('d M Y') }} @empty
No invoice usages found.

No invoices matching this influencer's promocodes were found in {{ $selectedPeriodLabel }}.

@endforelse
@endsection