@extends('layouts.app') @section('namePage', 'Dashboard') @php $colorClassMap = [ 'blue' => [ 'bg' => 'bg-blue-100', 'dark' => 'dark:bg-blue-900', 'text' => 'text-blue-500', 'border' => 'border-blue-500', ], 'red' => [ 'bg' => 'bg-red-100', 'dark' => 'dark:bg-red-900', 'text' => 'text-red-500', 'border' => 'border-red-500', ], 'yellow' => [ 'bg' => 'bg-yellow-100', 'dark' => 'dark:bg-yellow-900', 'text' => 'text-yellow-500', 'border' => 'border-yellow-500', ], 'green' => [ 'bg' => 'bg-green-100', 'dark' => 'dark:bg-green-900', 'text' => 'text-green-500', 'border' => 'border-green-500', ], 'indigo' => [ 'bg' => 'bg-indigo-100', 'dark' => 'dark:bg-indigo-900', 'text' => 'text-indigo-500', 'border' => 'border-indigo-500', ], 'zinc' => [ 'bg' => 'bg-zinc-100', 'dark' => 'dark:bg-zinc-900', 'text' => 'text-zinc-500', 'border' => 'border-zinc-500', ], 'neutral' => [ 'bg' => 'bg-neutral-100', 'dark' => 'dark:bg-neutral-900', 'text' => 'text-neutral-500', 'border' => 'border-neutral-500', ], 'purple' => [ 'bg' => 'bg-purple-100', 'dark' => 'dark:bg-purple-900', 'text' => 'text-purple-500', 'border' => 'border-purple-500', ], 'teal' => [ 'bg' => 'bg-teal-100', 'dark' => 'dark:bg-teal-900', 'text' => 'text-teal-500', 'border' => 'border-teal-500', ], ]; $cards = [ [ 'title' => 'Outlook Daily dan Weekly', 'count' => $jumlahOutlook . ' Outlook', 'color' => 'red', 'icon' => 'fa-folder', 'route' => 'outlookfolder.index', ], [ 'title' => 'Materi e-Book', 'count' => $jumlahMateri . ' Materi', 'color' => 'blue', 'icon' => 'fa-book', 'route' => 'folder.index', ], [ 'title' => 'Quiz Dikerjakan', 'count' => $riwayatUserLogin . ' Kuis', 'color' => 'yellow', 'icon' => 'fa-person-circle-question', 'route' => 'riwayat.index', ], [ 'title' => 'Piagam', 'count' => $jumlahSertifikat . ' Sertifikat', 'color' => 'green', 'icon' => 'fa-duotone fa-regular fa-certificate', 'route' => 'sertifikat.index', ], [ 'title' => 'User Aktif', 'count' => $jumlahUser . ' User', 'color' => 'purple', 'icon' => 'fa-users', // 'route' => 'trainer.index', ], ]; if (Auth::check() && Auth::user()->role === 'Admin') { // $cards[] = [ // 'title' => 'User Aktif', // 'count' => $jumlahUser . ' User', // 'color' => 'purple', // 'icon' => 'fa-users', // 'route' => 'trainer.index', // ]; $cards[] = [ 'title' => 'Jumlah Admin', 'count' => $jumlahAdmin . ' Admin', 'color' => 'teal', 'icon' => 'fa-user-shield', 'route' => 'admin.index', ]; } @endphp @section('content')

Dashboard

Selamat datang kembali, {{ Auth::user()->name }}!

@if ($isIncomplete) @endif
@foreach ($cards as $card) @php $color = $card['color']; $classes = $colorClassMap[$color] ?? $colorClassMap['blue']; @endphp @if (!empty($card['route'])) @endif

{{ $card['title'] }}

{{ $card['count'] }}

@if (!empty($card['route']))
@endif @endforeach
@endsection