Add hero sections to Visits, Hosts, Employees, Devices, Branches, and Team index pages.
Deploy Ladill Frontdesk / deploy (push) Successful in 1m3s
Deploy Ladill Frontdesk / deploy (push) Successful in 1m3s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -42,7 +42,17 @@ class VisitController extends Controller
|
||||
->paginate(25)
|
||||
->withQueryString();
|
||||
|
||||
return view('frontdesk.visits.index', compact('visits', 'organization'));
|
||||
$statsQuery = Visit::owned($this->ownerRef($request))
|
||||
->where('organization_id', $organization->id);
|
||||
$this->scopeToBranch($request, $statsQuery);
|
||||
|
||||
$heroStats = [
|
||||
'on_site' => (clone $statsQuery)->whereIn('status', Visit::ACTIVE_STATUSES)->count(),
|
||||
'today' => (clone $statsQuery)->whereDate('checked_in_at', today())->count(),
|
||||
'total' => (clone $statsQuery)->count(),
|
||||
];
|
||||
|
||||
return view('frontdesk.visits.index', compact('visits', 'organization', 'heroStats'));
|
||||
}
|
||||
|
||||
public function calendar(Request $request): View
|
||||
|
||||
Reference in New Issue
Block a user