laravel-rs/app/Http/Controllers/DashboardController.php
Uchiha Bayu Senju 4654a2e350
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
Upload
2025-04-27 23:55:09 +07:00

24 lines
675 B
PHP

<?php
namespace App\Http\Controllers;
use Carbon\Carbon;
use App\Models\Doctor;
use App\Models\Patient;
use App\Models\Payment;
use App\Models\Registration;
use Illuminate\Http\Request;
class DashboardController extends Controller
{
public function index()
{
$totalPatients = Patient::count();
$totalDoctors = Doctor::count();
$todayRegistrations = Registration::whereDate('registration_date', Carbon::today())->count();
$todayIncome = Payment::whereDate('payment_date', Carbon::today())->sum('total_amount');
return view('dashboard', compact('totalPatients', 'totalDoctors', 'todayRegistrations', 'todayIncome'));
}
}