added feature for binding form to page and fixing bugs
This commit is contained in:
@@ -141,11 +141,18 @@ class ClientAdditionalEducationController extends Controller
|
||||
fn() => $this->seoPageProvider->getSeoForModel($additionalEducationModel)
|
||||
);
|
||||
|
||||
if (array_key_exists('custom_form', request()->input('settings_page'))) {
|
||||
$form = request()->input('settings_page')['custom_form'];
|
||||
} else {
|
||||
$form = null;
|
||||
}
|
||||
|
||||
$additionalEducation = new AdditionalEducationResource($additionalEducationModel);
|
||||
|
||||
|
||||
return Inertia::render('Client/Additional-educations/Show', compact(
|
||||
'additionalEducation',
|
||||
'seo'
|
||||
'seo',
|
||||
'form',
|
||||
));
|
||||
}}
|
||||
|
||||
@@ -49,7 +49,7 @@ class MainController extends Controller
|
||||
|
||||
$educations = $this->getEducationsData();
|
||||
|
||||
$posts = Cache::remember('recent_posts', now()->addHour(), function () {
|
||||
$posts = Cache::remember('posts_recent', now()->addHour(), function () {
|
||||
return $this->getRecentPosts();
|
||||
});
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ class PageController extends Controller
|
||||
->first();
|
||||
});
|
||||
|
||||
|
||||
if ($page === null) {
|
||||
abort(404);
|
||||
}
|
||||
@@ -51,6 +52,7 @@ class PageController extends Controller
|
||||
abort($page->code);
|
||||
}
|
||||
|
||||
|
||||
return Inertia::render('Page', compact('page', 'subSectionPages', 'seo'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ class AccessCheck
|
||||
abort($registeredRoute->code);
|
||||
}
|
||||
|
||||
$request->merge(['settings_page' => $registeredRoute->settings]);
|
||||
|
||||
// Если все проверки пройдены, продолжаем выполнение запроса
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
@@ -23,8 +23,9 @@ class FormTimePeriodMiddleware
|
||||
abort(Response::HTTP_NOT_FOUND, 'Form not found');
|
||||
}
|
||||
|
||||
|
||||
if (!isset($form->settings['period'])) {
|
||||
abort(Response::HTTP_BAD_REQUEST, 'Invalid form settings');
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
$period = $form->settings['period'];
|
||||
|
||||
Reference in New Issue
Block a user