Add hero section to Watchlist index with entry stats and CTAs.
Deploy Ladill Frontdesk / deploy (push) Successful in 31s
Deploy Ladill Frontdesk / deploy (push) Successful in 31s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -35,10 +35,20 @@ class WatchlistController extends Controller
|
||||
->paginate(25)
|
||||
->withQueryString();
|
||||
|
||||
$statsQuery = WatchlistEntry::owned($this->ownerRef($request))
|
||||
->where('organization_id', $organization->id);
|
||||
|
||||
$heroStats = [
|
||||
'total' => (clone $statsQuery)->count(),
|
||||
'requires_approval' => (clone $statsQuery)->where('status', Visitor::WATCHLIST_REQUIRES_APPROVAL)->count(),
|
||||
'blacklisted' => (clone $statsQuery)->where('status', Visitor::WATCHLIST_BLACKLISTED)->count(),
|
||||
];
|
||||
|
||||
return view('frontdesk.watchlist.index', [
|
||||
'entries' => $entries,
|
||||
'organization' => $organization,
|
||||
'statuses' => config('frontdesk.watchlist_statuses'),
|
||||
'heroStats' => $heroStats,
|
||||
'canManage' => app(\App\Services\Frontdesk\FrontdeskPermissions::class)
|
||||
->can($this->member($request), 'watchlist.manage'),
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user