@extends('layouts.portal') @section('title', 'My Performance') @section('page_title', 'Performance Dashboard') @section('page_subtitle', 'Track your monthly performance and rankings') @section('sidebar') @include('agent.partials.sidebar', ['active' => 'performance']) @endsection @section('content')

This Month's Referrals

{{ array_sum($monthlyStats['referrals']) }}

This Month's Commission

${{ number_format(array_sum($monthlyStats['commissions']), 2) }}

Top Performer Rank

@php $myRank = collect($topPerformers)->search(fn($p) => $p['name'] === Auth::user()->name); echo $myRank !== false ? '#' . ($myRank + 1) : 'N/A'; @endphp

Monthly Referrals

Monthly Commissions

Top Performers This Month

@if(count($topPerformers) > 0)
@foreach($topPerformers as $index => $performer)
{{ $index + 1 }}

{{ $performer['name'] }}

@if($performer['name'] === Auth::user()->name) You @endif

{{ $performer['referrals'] }} referrals

${{ number_format($performer['commission'], 2) }}

@endforeach
@else

No performance data available yet

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