checkOnboardingStatus(); }); } public function clearCache(): void { Cache::forget('onboarding_needed'); } private function checkOnboardingStatus(): bool { $onboardingSkipped = Setting::where('key', 'onboarding_skipped')->value('value') === 'true'; $onboardingCompleted = Setting::where('key', 'onboarding_completed')->exists(); // If skipped or completed, no onboarding needed if ($onboardingCompleted || $onboardingSkipped) { return false; } // Check if all components exist $hasPlatformAccount = PlatformAccount::where('is_active', true)->exists(); $hasFeed = Feed::where('is_active', true)->exists(); $hasChannel = PlatformChannel::where('is_active', true)->exists(); $hasRoute = Route::where('is_active', true)->exists(); $hasAllComponents = $hasPlatformAccount && $hasFeed && $hasChannel && $hasRoute; return !$hasAllComponents; } }