29 lines
736 B
PHP
29 lines
736 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Gesture;
|
|
use App\Models\History;
|
|
use App\Models\Community;
|
|
use App\Models\SocialMedia;
|
|
|
|
class DashboardController extends Controller
|
|
{
|
|
// Halaman Dashboard User
|
|
public function userIndex()
|
|
{
|
|
// Ambil data komunitas dan sosmed agar tidak undefined
|
|
$communities = Community::all();
|
|
$socials = SocialMedia::all();
|
|
|
|
return view('dashboard-user', compact('communities', 'socials'));
|
|
}
|
|
|
|
// Halaman Dashboard Admin
|
|
public function adminIndex()
|
|
{
|
|
$totalGesture = Gesture::count();
|
|
$totalRiwayat = History::count();
|
|
return view('dashboard-admin', compact('totalGesture', 'totalRiwayat'));
|
|
}
|
|
} |