@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')

{{ __('Let’s get started 🚀') }}

@php $search_words = [__('content repurpose'), __('marketing email'), __('article generator'), __('ad script'), __('viral ideas'), __('tiktok video script')]; @endphp
@foreach ($search_words as $word) @endforeach
@if (setting('announcement_active', 0) && !auth()->user()->dash_notify_seen)

@lang(setting('announcement_title', 'Welcome'))

@lang(setting('announcement_description', 'We are excited to have you here. Explore the marketplace to find the best AI models for your needs.'))

@if (setting('announcement_url', '#') !== '#') {{ setting('announcement_button_text', 'Try it Now') }} @endif @lang('Dismiss')
@if (setting('announcement_image_dark')) @endif @lang(setting('announcement_title', 'Welcome to MagicAI!'))
@endif @include('panel.user.finance.subscriptionStatus') @if (!$user_is_premium)

@lang('Special Offer 🥳')

@lang('Limited offer to upgrade your package.')

@lang('Select a premium plan and start growing your social media.')

    @foreach ($premium_features as $feature)
  • {{ $feature }}
  • @endforeach
@lang('Select a Plan')
@endif @if (showTeamFunctionality())

@lang('Invite Team Members')

@if ($team && $team?->allow_seats > 0)
{{ __('Team') }}

@lang('Invite your colleagues and collaborators to join a team.')

@csrf @if ($app_is_demo) @lang('Invite Friends') @else @lang('Send Invitation') @endif
@else

{{ __('How it Works') }}

  1. 1 {!! __('You send your invitation link to your friends.') !!}
  2. 2 {!! __('They subscribe to a paid plan by using your refferral link.') !!}
  3. 3 @if ($is_onetime_commission) {!! __('From their first purchase, you will begin earning one-time commissions.') !!} @else {!! __('From their first purchase, you will begin earning recurring commissions.') !!} @endif
{{ __('Send') }}
@endif
@endif @if ($setting->feature_affilates)

@lang('Referral Link')

🎁

{{ __('Refer new users and earn commissions.') }}

{{ __('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) }}

@endif
@includeFirst(['social-media::theme.platforms', 'vendor.empty'])
@includeFirst(['social-media::theme.scheduled', 'vendor.empty']) @includeFirst(['social-media::theme.posts', 'vendor.empty'])

@lang('Documents')

{{ __('View All') }}
@forelse (Auth::user()->openai()->with('generator')->take(4)->get() as $entry) @if ($entry->generator != null)

{{ $entry->generator->title }}

@if (filled($entry->title))
{{ str()->words($entry->title, 5) }}
@endif

{{ str()->words(__($entry->generator->description), 8) }}

@if ($entry->generator->image !== 'none') {!! html_entity_decode($entry->generator->image) !!} @endif
@endif @empty

@lang('No documents have been created yet.')

@endforelse
@includeFirst(['advanced-image::shared-components.templates', 'vendor.empty'])
{{-- blade-formatter-disable --}} {{-- blade-formatter-enable --}} @endsection