@vite(['resources/css/tutorial.css', 'resources/js/tutorial/main.js'])

Dashboard

Welcome back, {{ Auth::user()->name }}! Continue your learning journey.

@if(Auth::user()->avatar_frame)
@endif @if(Auth::user()->getProfilePictureUrl()) Profile @else {{ strtoupper(substr(Auth::user()->name, 0, 1)) }} @endif
{{ Auth::user()->id === 1 ? 'Super Admin' : (Auth::user()->is_admin ? 'Admin' : 'PolyLearner') }}

{{ Auth::user()->name }}

@php // Calculate completed courses count from actual progress $actualCompletedCount = isset($enrolledCourses) ? $enrolledCourses->filter(fn($c) => ($c->progress ?? 0) >= 100)->count() : 0; // Calculate badge tier based on completed courses $badgeTiers = [ ['min' => 12, 'name' => 'Master', 'icon' => '👑', 'color' => '#fbbf24', 'css_class' => 'tier-master'], ['min' => 9, 'name' => 'Expert', 'icon' => '💎', 'color' => '#22d3ee', 'css_class' => 'tier-expert'], ['min' => 6, 'name' => 'Achiever', 'icon' => '⭐', 'color' => '#a855f7', 'css_class' => 'tier-achiever'], ['min' => 3, 'name' => 'Explorer', 'icon' => '🔍', 'color' => '#3b82f6', 'css_class' => 'tier-explorer'], ['min' => 1, 'name' => 'Beginner', 'icon' => '🌱', 'color' => '#22c55e', 'css_class' => 'tier-beginner'], ]; $currentBadge = null; foreach ($badgeTiers as $tier) { if ($actualCompletedCount >= $tier['min']) { $currentBadge = $tier; break; } } // Tier Upgrade Detection - Check if user has upgraded to a new tier $previousTierName = session('user_tier_name'); $currentTierName = $currentBadge ? $currentBadge['name'] : null; $tierUpgraded = false; $previousTierData = null; // Only trigger upgrade if we have both previous and current tier and they're different if ($previousTierName && $currentTierName && $previousTierName !== $currentTierName) { // Find previous tier data for the modal foreach ($badgeTiers as $tier) { if ($tier['name'] === $previousTierName) { $previousTierData = $tier; break; } } // Only show upgrade if moving UP (lower min value = higher tier) if ($previousTierData && $currentBadge && $currentBadge['min'] > $previousTierData['min']) { $tierUpgraded = true; } } // Always update session with current tier session(['user_tier_name' => $currentTierName]); @endphp @if($currentBadge)
{{ $currentBadge['icon'] }}
@else
🎯
@endif
{{-- SUCCESS MESSAGE --}} @if(session('success'))
{{ session('success') }}
@endif {{-- ERROR MESSAGE --}} @if(session('error'))
{{ session('error') }}
@endif {{-- INFO MESSAGE --}} @if(session('info'))
{{ session('info') }}
@endif {{-- ENROLLED COURSES SECTION --}} @if (isset($enrolledCourses) && $enrolledCourses->isNotEmpty()) @php // Separate completed and in-progress courses $completedCourses = $enrolledCourses->filter(fn($c) => ($c->progress ?? 0) >= 100); $inProgressCourses = $enrolledCourses->filter(fn($c) => ($c->progress ?? 0) < 100)->sortByDesc('progress'); $visibleCourses = $inProgressCourses->take(6); @endphp

📚 Your Enrolled Courses

@if($inProgressCourses->count() > 0)
@foreach ($visibleCourses as $course)
{{ $course->title }}

{{ $course->title }}

{{ $course->description ?? 'Learn at your own pace with our comprehensive course.' }}

Progress {{ $course->progress ?? 0 }}%
@endforeach
@if($inProgressCourses->count() > 6)
@endif @else {{-- All courses are completed --}}
🎉

All Courses Completed!

Congratulations! You've completed all your enrolled courses. Click the button below to enroll in more courses or view your completed courses.

Browse More Courses @if($completedCourses->count() > 0) @endif
@endif @else {{-- EMPTY STATE: NO COURSES ENROLLED --}}

Enroll in a Course

You haven't enrolled in any courses yet. Click the plus icon above or the button below to browse our collection and start learning!

Browse All Courses
@endif
@auth @if(session('just_logged_in') || request()->query('welcome') == 1) @php // Check if this is user's first login ever (set in AuthController) $isNewUser = session('first_time_user', false); @endphp @endif @endauth @if(Auth::check() && Auth::user()->is_admin)
INITIATING EVIL PROTOCOL
💀
[ ACCESSING EVIL DOMAIN... ]
01001000 01000001 01000011 01001011
@endif
👋

Leaving so soon?

Are you sure you want to logout from PolyLearn?

🏆

Achievement Tiers

Complete courses to unlock higher tiers!

@php $completedCount = isset($enrolledCourses) ? $enrolledCourses->filter(fn($c) => ($c->progress ?? 0) >= 100)->count() : 0; $allTiers = [ ['min' => 12, 'name' => 'Master', 'icon' => '👑', 'color' => '#fbbf24', 'desc' => 'Ultimate language champion'], ['min' => 9, 'name' => 'Expert', 'icon' => '💎', 'color' => '#22d3ee', 'desc' => 'Highly skilled polyglot'], ['min' => 6, 'name' => 'Achiever', 'icon' => '⭐', 'color' => '#a855f7', 'desc' => 'Dedicated learner'], ['min' => 3, 'name' => 'Explorer', 'icon' => '🔍', 'color' => '#3b82f6', 'desc' => 'Curious adventurer'], ['min' => 1, 'name' => 'Beginner', 'icon' => '🌱', 'color' => '#22c55e', 'desc' => 'Starting the journey'], ]; @endphp
{{ $completedCount }} Courses Completed
@foreach($allTiers as $tier) @php $isUnlocked = $completedCount >= $tier['min']; $isCurrent = false; if ($isUnlocked) { // Check if this is the current tier (highest unlocked) $higherTiers = array_filter($allTiers, fn($t) => $t['min'] > $tier['min'] && $completedCount >= $t['min']); $isCurrent = empty($higherTiers); } $tierClass = 'tier-' . strtolower($tier['name']); @endphp
{{ $tier['icon'] }}
{{ $tier['name'] }} @if($isCurrent) Current @endif

{{ $tier['desc'] }}

@if($isUnlocked) Unlocked @else 🔒 {{ $tier['min'] }} courses needed @endif
@if(!$isUnlocked)
{{ $completedCount }}/{{ $tier['min'] }}
@endif
@endforeach
@if(Auth::user()->avatar_frame)
@endif @if(Auth::user()->getProfilePictureUrl()) Profile @else {{ strtoupper(substr(Auth::user()->name, 0, 1)) }} @endif
@if(Auth::user()->id === 1) ⭐ Super Admin @elseif(Auth::user()->is_admin) 🛡️ Admin @else PolyLearner @endif

{{ Auth::user()->name }}

{{ Auth::user()->email }}

Member since {{ Auth::user()->created_at->format('M j, Y') }}

View Full Profile
@if(isset($tierUpgraded) && $tierUpgraded && isset($currentBadge) && isset($previousTierData))
🎉

Congratulations!

You've reached a new tier!

{{ $previousTierData['icon'] }}
{{ $previousTierData['name'] }}
{{ $currentBadge['icon'] }}
{{ $currentBadge['name'] }}

Keep up the amazing work! Complete more courses to unlock even higher tiers.

@endif @auth @endauth