24 lines
675 B
PHP
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'));
|
|
}
|
|
}
|