@php use App\Extensions\SocialMedia\System\Models\SocialMediaPost; use App\Extensions\SocialMedia\System\Enums\StatusEnum; use Illuminate\Support\Carbon; use App\Models\Currency; use App\Models\Setting; $user = Auth::user(); $list = $user->affiliates; $list2 = $user->withdrawals; $totalEarnings = 0; foreach ($list as $affOrders) { $totalEarnings += $affOrders->orders->sum('affiliate_earnings'); } $totalWithdrawal = 0; foreach ($list2 as $affWithdrawal) { $totalWithdrawal += $affWithdrawal->amount; } $earnings = $totalEarnings - $totalWithdrawal; if ($earnings < 0) { $earnings = 0; } // Get currency $currencyId = Setting::getCache()->default_currency ?? 124; $currency = Currency::find($currencyId); if ($app_is_demo) { $premium_features = [__('Unlimited Credits'), __('Smart Schedule'), __('FB, IG, X, Linkedin Channels'), __('Premium Support')]; } else { $premium_features = \App\Models\OpenAIGenerator::query()->where('active', 1)->where('premium', 1)->get()->pluck('title')->toArray(); } $user_is_premium = false; $plan = auth()->user()?->relationPlan; if ($plan) { $planType = strtolower($plan->plan_type ?? 'all'); if ($plan->plan_type === 'all' || $plan->plan_type === 'premium') { $user_is_premium = true; } } @endphp @extends('panel.layout.app', ['disable_tblr' => true]) @section('title', __('Dashboard')) @section('titlebar_title') {{ __('Welcome') }}, {{ auth()->user()->name }}. @endsection @section('titlebar_subtitle') {{ __('I’ll help you to create stunning social media content effortlessly.') }} @endsection @section('content')
@lang(setting('announcement_description', 'We are excited to have you here. Explore the marketplace to find the best AI models for your needs.'))
@lang('Select a premium plan and start growing your social media.')
@lang('Invite your colleagues and collaborators to join a team.')
@else{{ __('Simply share your referral link and have your friends sign up through it.') }}
{{ __('Referral Earnings') }}
@if (currencyShouldDisplayOnRight(currency()->symbol)) {{ $totalEarnings - $totalWithdrawal }}{{ currency()->symbol }} @else {{ currency()->symbol }}{{ $totalEarnings - $totalWithdrawal }} @endif
{{ str()->limit(url('/') . '/register?aff=' . \Illuminate\Support\Facades\Auth::user()->affiliate_code, 60) }}
{{ $entry->generator->title }}
@if (filled($entry->title)){{ str()->words(__($entry->generator->description), 8) }}