@extends('layouts.user.base') @section('page-title') Plans @endsection @php $system_wallets = App\Models\Wallet\SystemWallet::get()->toArray(); $user = auth()->user(); $is_first_timer = $user->investments->count() == 0; $last_calculated_plan = App\Models\Investments\CalculatorLog::where('user_id', $user->id)->orderBy('id', 'DESC')->with(['plan'])->first(); $show_calculator_reminder = $last_calculated_plan ? 1 : 0; @endphp @section('content') @if($last_calculated_plan) @endif
@foreach ($categories as $category) {{--
--}}
@foreach ($category->plans as $plan) @php $showPlan = $plan->users->count() == 0; if (!$showPlan) { $showPlan = $plan->users->where('user_id', $user->id)->count() > 0; } @endphp @if($showPlan) @if($plan->first_timer_only == _TRUE && $is_first_timer) @include('user.plans.components.plan', ["plan_model" => $plan, "showBuyLInk" => 1]) @endif @if($plan->first_timer_only == _FALSE) @include('user.plans.components.plan', ["plan_model" => $plan, "showBuyLInk" => 1]) @endif @endif @endforeach
@endforeach
@endsection @section('scripts') @endsection