- Plan upgrade/downgrade flow: UpgradeController with price difference calculations, Upgrade.vue with feature comparison and confirmation dialog - Admin order management: Order model/migration/factory, OrderController with process/complete/cancel/notes, Index and Show pages with filters - Admin impersonation: start/stop endpoints, session-based tracking, impersonation banner in AccountLayout, audit logging - Contact form: ContactRequest validation, ContactController with email, marketing route for form submission - FlashMessages now supports info alerts - Inertia shared data includes impersonation state - 114 tests passing (623 assertions) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
33 lines
1.0 KiB
PHP
33 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Inertia\Middleware;
|
|
|
|
class HandleInertiaRequests extends Middleware
|
|
{
|
|
/** @return array<string, mixed> */
|
|
public function share(Request $request): array
|
|
{
|
|
return array_merge(parent::share($request), [
|
|
'auth' => fn () => [
|
|
'user' => $request->user() ? $request->user()->only('id', 'name', 'email', 'status') : null,
|
|
],
|
|
'flash' => fn () => [
|
|
'success' => $request->session()->get('success'),
|
|
'error' => $request->session()->get('error'),
|
|
'info' => $request->session()->get('info'),
|
|
],
|
|
'impersonating' => fn () => $request->session()->has('impersonator_id'),
|
|
'domains' => fn () => [
|
|
'marketing' => config('app.domains.marketing'),
|
|
'account' => config('app.domains.account'),
|
|
'admin' => config('app.domains.admin'),
|
|
],
|
|
]);
|
|
}
|
|
}
|