| 123456789101112131415161718192021222324252627282930313233 |
- <?php
-
- namespace App\Http\Controllers;
-
- use App\Models\Plan;
- use Inertia\Inertia;
- use Inertia\Response;
-
- /**
- * Our own home page, the one that sells AI Commerce to merchants. Prices come from the plans table,
- * so the page always shows what the Billing page charges.
- */
- class HomeController extends Controller
- {
- public function __invoke(): Response
- {
- return Inertia::render('home', [
- 'plans' => Plan::query()->orderBy('sort')->get()->map(fn (Plan $plan) => [
- 'key' => $plan->key,
- 'name' => $plan->name,
- // In ringgit.
- 'price' => $plan->price / 100,
- 'stores' => $plan->stores,
- 'regenerations' => $plan->regenerations,
- 'edits' => $plan->edits,
- 'period' => $plan->period,
- ]),
- 'trialDays' => (int) config('plans.trial_days'),
- // Stores live at "<name>.<this>", so the hero can show a shop's future address.
- 'storeDomain' => config('storefront.domain'),
- ]);
- }
- }
|