@extends('layouts.user', ['header' => true, 'nav' => true, 'demo' => true, 'settings' => $settings]) {{-- Custom CSS --}} @section('css') @endsection {{-- Get plan details --}} @php use App\User; use App\Plan; use App\Category; use Illuminate\Support\Facades\Auth; // Get user plan details $plan = User::where('user_id', Auth::user()->user_id)->first(); $active_plan = json_decode($plan->plan_details); // Default $purchasedPlan = ""; // Check active plan if ($active_plan != null) { // Check plan type is exists if (isset($active_plan->plan_type) == false) { // Get plan details $getPlan = Plan::where('plan_id', Auth::user()->plan_id)->first(); $active_plan->plan_type = env('APP_TYPE'); $active_plan->no_of_vcard_products = $getPlan->no_of_services; $active_plan->no_of_links = $getPlan->no_of_links; $active_plan->no_testimonials = $getPlan->no_testimonials; $active_plan->business_hours = $getPlan->business_hours; $active_plan->contact_form = $getPlan->contact_form; $active_plan->no_of_enquires = $getPlan->no_of_enquires; $active_plan->no_of_stores = $getPlan->no_of_vcards; $active_plan->no_of_categories = $getPlan->no_of_categories; $active_plan->no_of_store_products = $getPlan->no_of_services; $active_plan->pwa = $getPlan->pwa; $active_plan->password_protected = $getPlan->password_protected; $active_plan->advanced_settings = $getPlan->advanced_settings; $active_plan->additional_tools = $getPlan->additional_tools; // Update existing users plan details User::where('user_id', Auth::user()->user_id)->update([ 'plan_details' => json_encode($active_plan) ]); // Add category $category = new Category(); $category->user_id = Auth::user()->user_id; $category->category_id = "others"; $category->thumbnail = "images/categories/others.avif"; $category->category_name = "Others"; $category->save(); $purchasedPlan = env('APP_TYPE'); } else { $plan = User::where('user_id', Auth::user()->user_id)->first(); $active_plan = json_decode($plan->plan_details); $purchasedPlan = $active_plan->plan_type ; } } @endphp @section('content')
{{ __('FREE PLAN') }}
@else{{ __('Lifetime') }}
@else{{ $remaining_days > 0 ? $remaining_days : __('Plan Expired!') }}
@endif {{ __('Show details') }}