further improvements for the mobile admin

This commit is contained in:
Codex Agent
2025-12-12 21:47:34 +01:00
parent 1719d96fed
commit a35f81705d
15 changed files with 914 additions and 290 deletions

View File

@@ -139,11 +139,9 @@ class EventController extends Controller
unset($eventData['features']);
}
if ($settings === [] || $settings === null) {
unset($eventData['settings']);
} else {
$eventData['settings'] = $settings;
}
$settings['branding_allowed'] = $package->branding_allowed !== false;
$eventData['settings'] = $settings;
foreach (['password', 'password_confirmation', 'password_protected', 'logo_image', 'cover_image'] as $unused) {
unset($eventData[$unused]);
@@ -233,6 +231,7 @@ class EventController extends Controller
public function update(EventStoreRequest $request, Event $event): JsonResponse
{
$tenantId = $request->attributes->get('tenant_id');
$event->loadMissing('eventPackage.package');
if ($event->tenant_id !== $tenantId) {
return ApiError::response(
@@ -259,10 +258,16 @@ class EventController extends Controller
unset($validated[$unused]);
}
$brandingAllowed = optional($event->eventPackage?->package)->branding_allowed !== false;
if (isset($validated['settings']) && is_array($validated['settings'])) {
$validated['settings'] = array_merge($event->settings ?? [], $validated['settings']);
} else {
$validated['settings'] = $event->settings ?? [];
}
$validated['settings']['branding_allowed'] = $brandingAllowed;
$event->update($validated);
$event->load(['eventType', 'tenant']);