diff --git a/.env.example b/.env.example index 0e7f2758..03dde5c4 100644 --- a/.env.example +++ b/.env.example @@ -20,3 +20,7 @@ DOCKER_DATABASE_HOST_PORT=53853 DOCKER_REDIS_HOST_PORT=53852 DOCKER_INSTALL_XDEBUG=true DOCKER_HOST_USER_ID=1000 + +CONTACT_ENABLED=true +FAQ_ENABLED=true +NEWS_ENABLED=true diff --git a/app/Http/Middleware/HandleInertiaRequests.php b/app/Http/Middleware/HandleInertiaRequests.php index a3640bf2..e09b3fb5 100644 --- a/app/Http/Middleware/HandleInertiaRequests.php +++ b/app/Http/Middleware/HandleInertiaRequests.php @@ -15,6 +15,7 @@ public function share(Request $request): array return array_merge(parent::share($request), [ "auth" => $this->getAuthData($request), "flash" => $this->getFlashData($request), + "sections" => $this->getSectionsData(), ]); } @@ -33,4 +34,13 @@ protected function getFlashData(Request $request): Closure "info" => $request->session()->get("info"), ]; } + + protected function getSectionsData(): array + { + return [ + "faq_enabled" => config("keating.sections.faq_enabled"), + "contact_enabled" => config("keating.sections.contact_enabled"), + "news_enabled" => config("keating.sections.news_enabled"), + ]; + } } diff --git a/app/Policies/UserPolicy.php b/app/Policies/UserPolicy.php new file mode 100644 index 00000000..dd3508f1 --- /dev/null +++ b/app/Policies/UserPolicy.php @@ -0,0 +1,25 @@ + [ + "faq_enabled" => env("FAQ_ENABLED", true), + "contact_enabled" => env("CONTACT_ENABLED", true), + "news_enabled" => env("ABOUT_ENABLED", true), + ], +]; diff --git a/resources/js/Layouts/PublicLayout.vue b/resources/js/Layouts/PublicLayout.vue index 82a8b341..d5e39105 100644 --- a/resources/js/Layouts/PublicLayout.vue +++ b/resources/js/Layouts/PublicLayout.vue @@ -1,16 +1,17 @@