@php $plan = Auth::user()->activePlan(); $plan_type = 'regular'; if ($plan != null) { $plan_type = strtolower($plan->plan_type); } @endphp @extends('panel.layout.app', ['disable_tblr' => true]) @section('title', __('Dashboard')) @section('titlebar_title') {{ __('Welcome') }}, {{ auth()->user()->name }}. @endsection @section('content')
@include('panel.user.finance.subscriptionStatus')
@if ($ongoingPayments != null)
@include('panel.user.finance.ongoingPayments')
@endif

{{ __('Overview') }}

{{ __('Words Left') }}

@if (Auth::user()->remaining_words == -1) @lang('Unlimited') @else {{ number_format((int) Auth::user()->remaining_words) }} @endif

@if ($setting->feature_ai_image)

{{ __('Images Left') }}

@if (Auth::user()->remaining_images == -1) @lang('Unlimited') @else {{ number_format((int) Auth::user()->remaining_images) }} @endif

@endif

{{ __('Hours Saved') }}

{{ number_format(($total_words * 0.5) / 60) }}

{{ __('Your Documents') }}

{{ __('Documents') }}

@foreach (Auth::user()->openai()->with('generator')->orderBy('created_at', 'desc')->take(4)->get() as $entry) @if ($entry->generator != null) @endif @endforeach

{{ __('Favorite Templates') }}

@foreach (\Illuminate\Support\Facades\Auth::user()->favoriteOpenai as $entry) @php $upgrade = false; if ($entry->premium == 1 && $plan_type === 'regular') { $upgrade = true; } if ($upgrade) { $href = LaravelLocalization::localizeUrl(route('dashboard.user.payment.subscription')); } else { $href = LaravelLocalization::localizeUrl( route($entry->type === 'voiceover' ? 'dashboard.user.openai.generator.workbook' : 'dashboard.user.openai.generator', $entry->slug), ); } @endphp @if ($upgrade || $entry->active == 1) @else

@endif @if ($entry->image !== 'none') {!! html_entity_decode($entry->image) !!} @endif {{ __($entry->title) }} {{ str()->words(__($entry->description), 5) }} {{ __('in Workbook') }} {{ $entry->created_at->format('M d, Y') }} @if ($upgrade) {{ __('Upgrade') }} @endif @if ($upgrade || $entry->active == 1) @else

@endif @if ($loop->iteration == 4) @break @endif @endforeach
@endsection