@extends('super_admin.layouts.master')
@section('title', 'AI Services')
@section('page_title', '🤖 AI-Powered Services')
@section('content')
@php
// Get dynamic counts from database
$basicModuleCount = DB::table('plan_modules')->where('plan_id', 1)->count();
$standardModuleCount = DB::table('plan_modules')->where('plan_id', 2)->count();
$premiumModuleCount = DB::table('plan_modules')->where('plan_id', 3)->count();
$basicAiCount = \App\Models\Feature::where('is_ai_feature', true)
->whereIn('module_id', DB::table('plan_modules')->where('plan_id', 1)->pluck('module_id'))->count();
$standardAiCount = \App\Models\Feature::where('is_ai_feature', true)
->whereIn('module_id', DB::table('plan_modules')->where('plan_id', 2)->pluck('module_id'))->count();
$premiumAiCount = \App\Models\Feature::where('is_ai_feature', true)
->whereIn('module_id', DB::table('plan_modules')->where('plan_id', 3)->pluck('module_id'))->count();
@endphp
Total AI Features
{{ $stats['total_ai_features'] }}
Basic AI
{{ $stats['basic_ai'] }}
Basic
Standard AI
{{ $stats['standard_ai'] }}
Standard
Premium AI
{{ $stats['premium_ai'] }}
Premium
Modules with AI
{{ $stats['modules_with_ai'] }}
@forelse($aiFeatures as $feature)
{{ $feature->name }}
{{ $feature->module->name }}
{{ ucfirst($feature->tier) }}
{{ $feature->description ?? 'AI-powered feature for enhanced automation and intelligence.' }}
@empty
No AI features found for this plan.
View all AI features
@endforelse
@if(!$planFilter && $groupedFeatures->count() > 0)
AI Features by Module
@foreach($groupedFeatures as $moduleName => $features)
{{ $moduleName }}
{{ $features->count() }} AI
@foreach($features as $feature)
{{ $feature->name }}
{{ ucfirst($feature->tier) }}
@endforeach
@endforeach
@endif
@endsection