From e94618bbbe591fa0435d28d403a66e78982de051 Mon Sep 17 00:00:00 2001 From: Galih Anggoro Prasetya <83481679+galihap76@users.noreply.github.com> Date: Wed, 21 Jun 2023 23:44:40 +0700 Subject: [PATCH] Update Dashboard.php --- app/Http/Livewire/Dashboard.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Http/Livewire/Dashboard.php b/app/Http/Livewire/Dashboard.php index a55aed3..73dc3a0 100644 --- a/app/Http/Livewire/Dashboard.php +++ b/app/Http/Livewire/Dashboard.php @@ -9,10 +9,16 @@ class Dashboard extends Component { public function render() { + // Menghitung total semua mahasiswa $total_semua_mahasiswa = MahasiswaModel::count(); + + // Menghitung total mahasiswa yang statusnya aktif $total_mahasiswa_aktif = MahasiswaModel::where('status', '=', 'aktif')->count(); + + // Menghitung total mahasiswa yang statusnya tidak aktif $total_mahasiswa_tidak_aktif = MahasiswaModel::where('status', '=', 'tidak aktif')->count(); + // Mengembalikan tampilan livewire.dashboard dengan data yang diperlukan return view( 'livewire.dashboard', [