collectionPage( 'Skinbase AI Academy — Skinbase', 'Learn AI-powered creativity for wallpapers, digital art, skins, news covers, and visual worlds inside Skinbase.', $canonical, ) ->toArray(); $seo['og_type'] = 'website'; $home = $this->cache->homePayload(function (): array { return [ 'featuredLessons' => $this->cache->featuredLessons(), 'featuredPrompts' => $this->cache->featuredPrompts(), 'featuredChallenges' => (bool) config('academy.challenges_enabled', true) ? $this->cache->featuredChallenges() : [], 'lessonCount' => AcademyLesson::query()->active()->published()->count(), 'promptCount' => AcademyPromptTemplate::query()->active()->published()->count(), 'challengeCount' => (bool) config('academy.challenges_enabled', true) ? AcademyChallenge::query()->publiclyVisible()->count() : 0, ]; }); return Inertia::render('Academy/Index', [ 'seo' => $seo, 'pricingUrl' => route('academy.pricing'), 'links' => [ 'lessons' => route('academy.lessons.index'), 'prompts' => route('academy.prompts.index'), 'packs' => route('academy.packs.index'), 'challenges' => route('academy.challenges.index'), ], 'featureFlags' => [ 'paymentsEnabled' => (bool) config('academy.payments_enabled', false), 'challengesEnabled' => (bool) config('academy.challenges_enabled', true), 'badgesEnabled' => (bool) config('academy.badges_enabled', true), ], 'stats' => [ 'lessonCount' => (int) $home['lessonCount'], 'promptCount' => (int) $home['promptCount'], 'challengeCount' => (int) $home['challengeCount'], ], 'featuredLessons' => collect($home['featuredLessons'])->map(fn (AcademyLesson $lesson): array => $this->access->lessonPayload($lesson, $request->user()))->values()->all(), 'featuredPrompts' => collect($home['featuredPrompts'])->map(fn (AcademyPromptTemplate $prompt): array => $this->access->promptPayload($prompt, $request->user()))->values()->all(), 'featuredChallenges' => collect($home['featuredChallenges'])->map(fn (AcademyChallenge $challenge): array => $this->access->challengePayload($challenge, $request->user(), true))->values()->all(), ])->rootView('collections'); } }