AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

LegalController.php 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace App\Http\Controllers;
  3. use Illuminate\Support\Carbon;
  4. use Inertia\Inertia;
  5. use Inertia\Response;
  6. /**
  7. * Our privacy policy and terms of service. The wording lives in the React pages; this sends the facts
  8. * that can change: who runs the service, how to reach us, the trial length and which AI companies we use.
  9. */
  10. class LegalController extends Controller
  11. {
  12. public function privacy(): Response
  13. {
  14. return Inertia::render('legal/privacy', $this->details());
  15. }
  16. public function terms(): Response
  17. {
  18. return Inertia::render('legal/terms', $this->details());
  19. }
  20. /**
  21. * @return array<string, mixed>
  22. */
  23. private function details(): array
  24. {
  25. return [
  26. 'operator' => config('legal.operator'),
  27. 'registration' => config('legal.registration'),
  28. 'email' => config('legal.email'),
  29. 'address' => config('legal.address'),
  30. 'updated' => Carbon::parse(config('legal.updated'))->format('j F Y'),
  31. 'trialDays' => (int) config('plans.trial_days'),
  32. 'aiCompanies' => self::aiCompanies(),
  33. ];
  34. }
  35. /**
  36. * The companies behind the AI providers the tasks use right now, each named once.
  37. * The fake provider (tests, no keys) has no company and is left out.
  38. *
  39. * @return list<array{name: string, country: string}>
  40. */
  41. public static function aiCompanies(): array
  42. {
  43. return collect(config('ai.tasks'))
  44. ->pluck('provider')
  45. ->unique()
  46. ->map(fn (string $provider) => config("legal.ai_companies.{$provider}"))
  47. ->filter()
  48. ->unique('name')
  49. ->values()
  50. ->all();
  51. }
  52. }