Implemented a block editor for changing the layout of the page

This commit is contained in:
2026-04-04 01:17:05 +02:00
parent 0800f7664f
commit ff58e82497
41 changed files with 2706 additions and 298 deletions

View File

@@ -22,6 +22,7 @@ class SubscribePublicPageRequest extends FormRequest
{
/** @var PreregistrationPage $page */
$page = $this->route('publicPage');
$page->loadMissing('blocks');
$emailRule = (new Email)
->rfcCompliant()
@@ -31,7 +32,7 @@ class SubscribePublicPageRequest extends FormRequest
'first_name' => ['required', 'string', 'max:255'],
'last_name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'max:255', $emailRule],
'phone' => $page->phone_enabled
'phone' => $page->isPhoneFieldEnabledForSubscribers()
? ['nullable', 'string', 'regex:/^[0-9]{8,15}$/']
: ['nullable', 'string', 'max:255'],
];
@@ -73,7 +74,7 @@ class SubscribePublicPageRequest extends FormRequest
/** @var PreregistrationPage $page */
$page = $this->route('publicPage');
$phone = $this->input('phone');
if (! $page->phone_enabled) {
if (! $page->isPhoneFieldEnabledForSubscribers()) {
$this->merge(['phone' => null]);
return;