Expand settings beyond QR into a full Events preferences page.
Deploy Ladill Events / deploy (push) Successful in 51s

Add event notification toggles, new-event defaults that pre-fill creation, and tuck QR styling into a secondary section.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-06-07 13:31:22 +00:00
co-authored by Cursor
parent 8a1d5708a9
commit 30528a0c7f
7 changed files with 340 additions and 73 deletions
@@ -69,6 +69,7 @@ class AccountController extends Controller
return view('qr.account.settings', [
'account' => $account,
'settings' => $settings,
'eventDefaults' => $settings->resolvedEventDefaults(),
'style' => $style,
'moduleStyles' => QrModuleStyleCatalog::visible(),
'cornerOuterStyles' => QrCornerStyleCatalog::outerStyles(),
@@ -85,6 +86,17 @@ class AccountController extends Controller
'notify_email' => ['nullable', 'email', 'max:255'],
'product_updates' => ['nullable', 'boolean'],
'low_balance_alerts' => ['nullable', 'boolean'],
'notify_registrations' => ['nullable', 'boolean'],
'notify_payouts' => ['nullable', 'boolean'],
'event_defaults' => ['nullable', 'array'],
'event_defaults.currency' => ['nullable', 'in:GHS,USD,NGN,KES'],
'event_defaults.mode' => ['nullable', 'in:ticketing,contributions,free'],
'event_defaults.badge_size' => ['nullable', 'in:4x3,4x6,cr80'],
'event_defaults.brand_color' => ['nullable', 'regex:/^#[0-9a-fA-F]{6}$/'],
'event_defaults.organizer' => ['nullable', 'string', 'max:120'],
'event_defaults.registration_open' => ['nullable', 'boolean'],
'event_defaults.badge_fields' => ['nullable', 'array'],
'event_defaults.badge_fields.*' => ['nullable', 'string', 'max:40'],
'default_style' => ['nullable', 'array'],
'default_style.foreground' => ['nullable', 'regex:/^#[0-9a-fA-F]{6}$/'],
'default_style.background' => ['nullable', 'regex:/^#[0-9a-fA-F]{6}$/'],
@@ -102,12 +114,18 @@ class AccountController extends Controller
'default_style.gradient_rotation' => ['nullable', 'integer', 'min:0', 'max:360'],
]);
$eventDefaults = $data['event_defaults'] ?? [];
$eventDefaults['registration_open'] = $request->boolean('event_defaults.registration_open');
QrSetting::updateOrCreate(
['user_id' => $account->id],
[
'notify_email' => $data['notify_email'] ?? null,
'product_updates' => $request->boolean('product_updates'),
'low_balance_alerts' => $request->boolean('low_balance_alerts'),
'notify_registrations' => $request->boolean('notify_registrations'),
'notify_payouts' => $request->boolean('notify_payouts'),
'event_defaults' => QrSetting::sanitizeEventDefaults($eventDefaults),
'default_style' => QrSetting::sanitizeDefaultStyle($data['default_style'] ?? null),
],
);