You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
monitor-doc/app/Http/Controllers/GeneralController.php

22 lines
639 B
PHP

<?php
namespace App\Http\Controllers;
use App\Models\Document;
use App\Models\DocumentReminder;
use Illuminate\Http\Request;
class GeneralController extends Controller
{
public function index()
{
return inertia('Dashboard', [
'count_active' => Document::where('status', Document::ACTIVE)->count(),
'count_update' => Document::where('status', Document::UPDATE)->count(),
'count_expired' => Document::where('status', Document::EXPIRED)->count(),
'count_total' => Document::count(),
'events' => DocumentReminder::with('document.type')->get(),
]);
}
}