25 lines
640 B
PHP
25 lines
640 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use App\Models\User;
|
|
use App\Models\Room;
|
|
use App\Models\Booking;
|
|
|
|
class DashboardAdminController extends Controller
|
|
{
|
|
public function index()
|
|
{
|
|
// Mengambil data dari database
|
|
$totalUsers = User::count();
|
|
$totalRooms = Room::count();
|
|
$totalBookings = Booking::count();
|
|
$pendingBookings = Booking::where('status_booking', 'pending')->with('user', 'room')->get();
|
|
|
|
// Mengirim data ke view
|
|
return view('admin.dashboard', compact('totalUsers', 'totalRooms', 'totalBookings', 'pendingBookings'));
|
|
}
|
|
|
|
}
|