details()); } public function terms(): Response { return Inertia::render('legal/terms', $this->details()); } /** * @return array */ private function details(): array { return [ 'operator' => config('legal.operator'), 'registration' => config('legal.registration'), 'email' => config('legal.email'), 'address' => config('legal.address'), 'updated' => Carbon::parse(config('legal.updated'))->format('j F Y'), 'trialDays' => (int) config('plans.trial_days'), 'aiCompanies' => self::aiCompanies(), ]; } /** * The companies behind the AI providers the tasks use right now, each named once. * The fake provider (tests, no keys) has no company and is left out. * * @return list */ public static function aiCompanies(): array { return collect(config('ai.tasks')) ->pluck('provider') ->unique() ->map(fn (string $provider) => config("legal.ai_companies.{$provider}")) ->filter() ->unique('name') ->values() ->all(); } }