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:
@@ -25,7 +25,17 @@ class HostController extends Controller
|
||||
$this->scopeToBranch($request, $hosts);
|
||||
$hosts = $hosts->orderBy('name')->paginate(25);
|
||||
|
||||
return view('frontdesk.hosts.index', compact('hosts', 'organization'));
|
||||
$statsQuery = Host::owned($this->ownerRef($request))
|
||||
->where('organization_id', $organization->id);
|
||||
$this->scopeToBranch($request, $statsQuery);
|
||||
|
||||
$heroStats = [
|
||||
'total' => (clone $statsQuery)->count(),
|
||||
'available' => (clone $statsQuery)->where('is_available', true)->count(),
|
||||
'departments' => (clone $statsQuery)->whereNotNull('department')->where('department', '!=', '')->distinct()->count('department'),
|
||||
];
|
||||
|
||||
return view('frontdesk.hosts.index', compact('hosts', 'organization', 'heroStats'));
|
||||
}
|
||||
|
||||
public function create(Request $request): View
|
||||
|
||||
Reference in New Issue
Block a user