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:
@@ -27,10 +27,23 @@ class DeviceController extends Controller
|
||||
->orderBy('name')
|
||||
->paginate(25);
|
||||
|
||||
$statsQuery = Device::owned($this->ownerRef($request))
|
||||
->where('organization_id', $organization->id);
|
||||
|
||||
$heroStats = [
|
||||
'total' => (clone $statsQuery)->count(),
|
||||
'online' => (clone $statsQuery)
|
||||
->where('status', 'online')
|
||||
->where('last_online_at', '>=', now()->subMinutes(10))
|
||||
->count(),
|
||||
'kiosks' => (clone $statsQuery)->where('type', 'kiosk')->count(),
|
||||
];
|
||||
|
||||
return view('frontdesk.devices.index', [
|
||||
'organization' => $organization,
|
||||
'devices' => $devices,
|
||||
'deviceTypes' => config('frontdesk.device_types'),
|
||||
'heroStats' => $heroStats,
|
||||
'canManage' => app(\App\Services\Frontdesk\FrontdeskPermissions::class)
|
||||
->can($this->member($request), 'devices.manage'),
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user