@extends('layouts.dashboard') @section('title', __('Earnings')) @section('page_title', __('Earnings')) @section('content')

{{ __('Earnings & Payouts') }}

@php $myShare = optional(auth()->user()->instructorProfile)->commission_rate; $myShare = $myShare !== null ? (float) $myShare : 100 - (float) setting('admin_commission', 20); $myShareLabel = rtrim(rtrim(number_format($myShare, 2), '0'), '.'); @endphp

{{ __('Track your revenue and request payouts') }} · {{ __('Your revenue share: :n% of each sale', ['n' => $myShareLabel]) }} ({{ __('some courses may have their own rate') }})

{{ __('Total Earnings') }}
{{ money($totalEarnings) }}
{{ __('Available Balance') }}
{{ money($available) }}
{{ __('Paid Out') }}
{{ money($paidOut) }}
@if($stripe['enabled']) @php $sp = $stripe['profile']; @endphp
{{ __('Stripe payouts') }}
@if($sp?->stripe_payouts_enabled) {{ __('Connected — approved payouts are sent straight to your bank account.') }} @elseif($sp?->stripe_account_id) {{ __('Stripe still needs a few details before payouts can be sent.') }} @else {{ __('Connect a Stripe account to get paid automatically instead of by manual transfer.') }} @endif
@if($sp?->stripe_payouts_enabled) {{ __('Active') }} @else
@csrf
@endif
@endif
{{ __('Request a Payout') }}
@csrf
@error('amount')
{{ $message }}
@enderror {{ __('Available') }}: {{ money($available) }}
@error('method')
{{ $message }}
@enderror
{{ __('Payout History') }}
@forelse ($payouts as $payout) @php $pb = ['pending' => 'warning', 'approved' => 'info', 'paid' => 'success', 'rejected' => 'danger'][$payout->status] ?? 'secondary'; @endphp @empty @endforelse
{{ __('Date') }}{{ __('Amount') }}{{ __('Method') }}{{ __('Status') }}
{{ $payout->created_at->format('M d, Y') }} {{ money($payout->amount) }} {{ $payout->payoutMethod->method_name ?? '—' }} {{ status_label($payout->status) }}
{{ __('No payout requests yet.') }}
{{ __('Recent Sales') }}
@forelse ($recentSales as $item) @empty @endforelse
{{ __('Course') }}{{ __('Date') }}{{ __('Your Earning') }}
{{ $item->label() }} {{ $item->created_at->format('M d, Y') }} {{ money($item->instructor_commission) }}
{{ __('No sales yet.') }}
@endsection