first commit
This commit is contained in:
21
app/Http/Controllers/DashboardController.php
Normal file
21
app/Http/Controllers/DashboardController.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
namespace App\Http\Controllers;
|
||||
use App\Models\Contract;
|
||||
use App\Models\Building;
|
||||
use App\Models\Payment;
|
||||
use Inertia\Inertia;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$stats = [
|
||||
'total_contracts' => Contract::count(),
|
||||
'active_contracts' => Contract::where('status', 'active')->count(),
|
||||
'total_buildings' => Building::count(),
|
||||
'pending_payments' => Payment::where('status', 'pending')->count(),
|
||||
];
|
||||
|
||||
return Inertia::render('Dashboard', ['stats' => $stats]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user