environment('testing') && config('portal.qa_build_directory')) { $manifest = public_path(config('portal.qa_build_directory').'/manifest.json'); $version = is_file($manifest) ? hash_file('xxh128', $manifest) : false; return $version === false ? null : $version; } return parent::version($request); } /** * Define the props that are shared by default. * * @see https://inertiajs.com/shared-data * * @return array */ public function share(Request $request): array { return [ ...parent::share($request), 'name' => config('app.name'), 'profileAccess' => app(PortalProfileAccess::class)->navigation($request->user()), 'portalOperator' => config('portal.operator_name'), 'legacyContentEnabled' => app(LegacyContent::class)->available(), 'educationEnabled' => (bool) config('education.enabled', false), 'aiEnabled' => (bool) config('investmoz_ai.enabled', false), 'existingBusinessEnabled' => (bool) config('existing-business.enabled', false), 'businessReviewUrl' => config('existing-business.enabled') && $request->user()?->can('reviewQueue', ExistingBusiness::class) ? '/management/negocios' : null, 'investorPathEnabled' => app(InvestorPath::class)->available(), 'opportunityManagement' => config('portal.opportunity_dashboard_access_enabled') && $request->user() && app(PortalProfileAccess::class)->legacyWriteAllowed($request->user()) ? [ 'installed' => app(OpportunityManagement::class)->installed(), 'manage' => ['label' => 'Gestão de Oportunidades', 'href' => '/management/opportunities'], 'create' => ['label' => 'Nova oportunidade', 'href' => '/management/opportunities/create'], 'installationHref' => '/management/opportunity-management-install', ] : null, 'flash' => ['success' => fn () => $request->session()->get('success'), 'warning' => fn () => $request->session()->get('warning')], 'auth' => [ 'user' => $request->user(), 'canManagePortal' => $request->user()?->can('manage-portal') ?? false, ], 'sidebarOpen' => ! $request->hasCookie('sidebar_state') || $request->cookie('sidebar_state') === 'true', ]; } }