Fix endcustomer package allocation and event create gating
This commit is contained in:
@@ -110,7 +110,14 @@ class EventController extends Controller
|
||||
$tenantPackage = $tenant->tenantPackages()
|
||||
->with('package')
|
||||
->where('active', true)
|
||||
->where(function ($query) {
|
||||
$query->whereNull('expires_at')->orWhere('expires_at', '>', now());
|
||||
})
|
||||
->whereHas('package', fn ($query) => $query->withTrashed()->where('type', 'endcustomer'))
|
||||
->withCount('eventPackages')
|
||||
->orderBy('event_packages_count')
|
||||
->orderByDesc('purchased_at')
|
||||
->orderByDesc('id')
|
||||
->first();
|
||||
|
||||
$package = null;
|
||||
|
||||
Reference in New Issue
Block a user