Jumlah Pengguna
+0
+Jumlah Lahan
+0
+Jumlah indikator yang digunakan saat ini
+0
+Jumlah aturan yang telah ditetapkan
+diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index 119c906..a79c4df 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -2,13 +2,23 @@ namespace App\Http\Controllers; +use App\Models\Indicator; +use App\Models\Land; +use App\Models\Rule; +use App\Models\User; use Illuminate\Http\Request; class DashboardController extends Controller { public function admin() { - return view('dashboard.admin'); + $userCount = User::count(); + $landCount = Land::count(); + $indicatorCount = Indicator::whereIn('id', function ($query) { + $query->select('indicator_id')->from('rule'); + })->count(); + $rulesCount = Rule::count(); + return view('dashboard.admin', compact('userCount', 'landCount', 'indicatorCount', 'rulesCount')); } public function petugas() diff --git a/resources/views/dashboard/admin.blade.php b/resources/views/dashboard/admin.blade.php index d15d845..c15666f 100644 --- a/resources/views/dashboard/admin.blade.php +++ b/resources/views/dashboard/admin.blade.php @@ -1,6 +1,13 @@ @extends('layouts.app') @push('title', 'Dashboard Admin') @section('content') + @push('other-css') + + + @endpush +
Jumlah Pengguna
+Jumlah Lahan
+Jumlah indikator yang digunakan saat ini
+Jumlah aturan yang telah ditetapkan
+Jumlah Lahan
+Jumlah indikator yang digunakan saat ini
+