rearranged tenant admin layout, invite layouts now visible and manageable

This commit is contained in:
Codex Agent
2025-10-29 12:36:34 +01:00
parent a7bbf230fd
commit d781448914
31 changed files with 2190 additions and 1685 deletions

View File

@@ -39,10 +39,26 @@ class EventController extends Controller
$query = Event::where('tenant_id', $tenantId)
->with([
'eventType',
'photos',
'eventPackages.package',
'eventPackage.package',
])
->withCount([
'photos',
'photos as pending_photos_count' => fn ($photoQuery) => $photoQuery->where('status', 'pending'),
'tasks as tasks_count',
'joinTokens as total_join_tokens_count',
'joinTokens as active_join_tokens_count' => fn ($tokenQuery) => $tokenQuery
->whereNull('revoked_at')
->where(function ($query) {
$query->whereNull('expires_at')
->orWhere('expires_at', '>', now());
})
->where(function ($query) {
$query->whereNull('usage_limit')
->orWhereColumn('usage_limit', '>', 'usage_count');
}),
])
->withSum('photos as likes_sum', 'likes_count')
->orderBy('created_at', 'desc');
if ($request->has('status')) {