rearranged tenant admin layout, invite layouts now visible and manageable
This commit is contained in:
@@ -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')) {
|
||||
|
||||
Reference in New Issue
Block a user