@extends('themes.basic.business.layouts.app') @section('container', 'dashboard-container-lg') @section('title', d_trans('Pricing plans')) @section('content') @if ($countPlans > 0) @php $plans = [ [ 'count' => $weeklyPlans->count(), 'id' => 'week-tab', 'target' => '#pills-week', 'label' => 'Weekly', ], [ 'count' => $monthlyPlans->count(), 'id' => 'month-tab', 'target' => '#pills-month', 'label' => 'Monthly', ], [ 'count' => $yearlyPlans->count(), 'id' => 'year-tab', 'target' => '#pills-year', 'label' => 'Yearly', ], [ 'count' => $lifetimePlans->count(), 'id' => 'lifetime-tab', 'target' => '#pills-lifetime', 'label' => 'Lifetime', ], ]; $availablePlans = array_filter($plans, function ($plan) { return $plan['count'] > 0; }); $activePlan = $availablePlans ? reset($availablePlans) : null; $showSwitcher = count($availablePlans) > 1; @endphp