@extends('super_admin.layouts.master') @section('title', 'Plan Pricing Management') @section('page_title', 'Subscription Plans & Pricing') @section('content')

Plan Pricing

Manage subscription plans, modules and AI services

Create New Plan View All History

Total Plans

{{ $priceStats['total_plans'] }}

Active Plans

{{ $priceStats['active_plans'] }}

Total Modules

{{ \App\Models\Module::count() }}

Avg. Monthly Price

₹{{ number_format($priceStats['average_price']) }}

@forelse($plans as $plan) @php // Get modules assigned to this plan $planModuleIds = \DB::table('plan_modules') ->where('plan_id', $plan->id) ->pluck('module_id') ->toArray(); $planModules = \App\Models\Module::whereIn('id', $planModuleIds)->get(); $moduleCount = $planModules->count(); // Count AI features in these modules $aiFeatureCount = \App\Models\Feature::whereIn('module_id', $planModuleIds) ->where('is_ai_feature', true) ->count(); // Get total features count $totalFeatureCount = \App\Models\Feature::whereIn('module_id', $planModuleIds)->count(); // Count schools using this plan $schoolsUsingPlan = \App\Models\School::where('plan', $plan->plan_key)->count(); @endphp

{{ $plan->plan_name }}

{{ $plan->is_active ? 'Active' : 'Inactive' }} @if($schoolsUsingPlan > 0) {{ $schoolsUsingPlan }} @endif
@if($plan->ai_enabled) AI @endif
₹{{ number_format($plan->monthly_price) }} /month
@if($plan->yearly_price)

₹{{ number_format($plan->yearly_price) }}/year @php $savings = ($plan->monthly_price * 12) - $plan->yearly_price; @endphp @if($savings > 0) (Save ₹{{ number_format($savings) }}) @endif

@endif
{{ $moduleCount }}

Modules

{{ $aiFeatureCount }}

AI Services

@if($moduleCount > 0)

Included Modules

@foreach($planModules->take(3) as $module) {{ $module->name }} @endforeach @if($moduleCount > 3) +{{ $moduleCount - 3 }} more @endif
@endif
Total Features {{ $totalFeatureCount }}

Max Students

{{ $plan->max_students ?? '∞' }}

Max Teachers

{{ $plan->max_teachers ?? '∞' }}

@csrf @method('PATCH') @php if ($plan->is_active) { $btnClass = 'bg-gradient-to-r from-red-500 to-red-600 text-white hover:from-red-600 hover:to-red-700 shadow-lg shadow-red-200'; $icon = 'fa-toggle-off'; $btnText = 'Deactivate Plan'; $confirmTitle = 'Deactivate Plan?'; $confirmText = ($schoolsUsingPlan > 0 ? "{$schoolsUsingPlan} school(s) are currently using this plan. " : "") . "Existing schools will NOT be affected, but new schools cannot select this plan."; $confirmBtn = 'Yes, Deactivate'; $confirmColor = '#ef4444'; $iconColor = 'text-red-100'; } else { $btnClass = 'bg-gradient-to-r from-green-500 to-green-600 text-white hover:from-green-600 hover:to-green-700 shadow-lg shadow-green-200'; $icon = 'fa-toggle-on'; $btnText = 'Activate Plan'; $confirmTitle = 'Activate Plan?'; $confirmText = "This plan will be available for new schools to subscribe."; $confirmBtn = 'Yes, Activate'; $confirmColor = '#22c55e'; $iconColor = 'text-green-100'; } @endphp
@if($schoolsUsingPlan === 0)
@csrf @method('DELETE')
@else

{{ $schoolsUsingPlan }} school(s) using this plan

@endif
@empty

No Plans Found

Create your first subscription plan to get started.

Create Plan
@endforelse
@endsection @push('scripts') @endpush