*/ public function share(Request $request): array { // Load all published dynamic pages with each parent page relationship. $dynamicPageModels = DynamicPage::getModelsCached() ->where('status', PageStatusEnum::published); $dynamicPages = []; foreach ($dynamicPageModels as $dynamicPageModel) { $pascalCase = str_replace(' ', '', ucwords(str_replace('-', ' ', $dynamicPageModel->id_key))); $dynamicPages["page{$pascalCase}"] = $dynamicPageModel; } $props = [ ...InertiaHelper::errorProps(parent::share($request)), 'recaptchaKey' => config('services.google.recaptcha.public'), 'dynamicPages' => $dynamicPages, 'activitySectorEnum' => ActivitySectorEnum::toArray(), 'objectEnum' => ObjectEnum::toArray(), 'cookieEnv' => [ "matomoSiteId" => config('cookie-notice.matomo.site_id'), "recaptchaKey" => config('cookie-notice.google.recaptcha.public'), "recaptchaBypassKey" => config('cookie-notice.google.recaptcha.bypassKey'), "gaMeasurementId" => config('cookie-notice.google.analytics.id') ], 'ziggy' => fn (): array => [ // Routes ziggy. ...new Ziggy()->toArray(), // Use for route().current() by ziggy. 'location' => $request->url(), ], // More props here. ]; return array_replace_recursive( $props, InertiaSharedRegistry::resolve($request) ); } }