Add hero sections to Patients, Appointments, Queue, and admin index pages.
Deploy Ladill Care / deploy (push) Successful in 37s
Deploy Ladill Care / deploy (push) Successful in 37s
Introduce shared x-care.page-hero with summary stats so key list views match the Ladill app hero pattern used across Frontdesk and Link. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -35,6 +35,16 @@ class DrugController extends Controller
|
||||
$lowStock = $this->pharmacy->lowStock($this->ownerRef($request), $organization->id);
|
||||
$expired = $this->pharmacy->expiredBatches($this->ownerRef($request), $organization->id);
|
||||
|
||||
$drugQuery = Drug::owned($this->ownerRef($request))
|
||||
->where('organization_id', $organization->id)
|
||||
->when($branchScope, fn ($q) => $q->where('branch_id', $branchScope));
|
||||
|
||||
$heroStats = [
|
||||
'total' => (clone $drugQuery)->count(),
|
||||
'low_stock' => $lowStock->count(),
|
||||
'expired' => $expired->count(),
|
||||
];
|
||||
|
||||
return view('care.pharmacy.drugs.index', [
|
||||
'organization' => $organization,
|
||||
'drugs' => $drugs,
|
||||
@@ -42,6 +52,7 @@ class DrugController extends Controller
|
||||
'expired' => $expired,
|
||||
'canManage' => app(\App\Services\Care\CarePermissions::class)
|
||||
->can($this->member($request), 'pharmacy.manage'),
|
||||
'heroStats' => $heroStats,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user