prefix('platform')->group(function (): void { Route::get('/hosting-products', [PlatformHostingController::class, 'products']); Route::get('/users/{publicId}/hosting-accounts', [PlatformHostingController::class, 'index']) ->where('publicId', '[A-Za-z0-9\-]+'); Route::post('/users/{publicId}/hosting-accounts', [PlatformHostingController::class, 'assign']) ->where('publicId', '[A-Za-z0-9\-]+'); Route::patch('/hosting-accounts/{account}/duration', [PlatformHostingController::class, 'updateDuration']) ->whereNumber('account'); Route::post('/hosting-accounts/{account}/renew', [PlatformHostingController::class, 'renew']) ->whereNumber('account'); Route::post('/hosting-accounts/{account}/unsuspend', [PlatformHostingController::class, 'unsuspend']) ->whereNumber('account'); }); // Ladill Email API (v1) — authenticated with Sanctum personal access tokens // minted on the Developers page. Read-only for now: identity + mailboxes. Route::middleware('auth:sanctum')->prefix('v1')->group(function () { Route::get('/me', function (Request $request) { $u = $request->user(); return ['id' => $u->public_id, 'name' => $u->name, 'email' => $u->email]; }); Route::get('/mailboxes', function (Request $request, MailboxClient $mailboxes) { return ['data' => $mailboxes->forUser((string) $request->user()->public_id)]; }); });