feat(auth): add auth and account controllers

This commit is contained in:
dualfroz committed 2026-08-25 13:45:21 +02:00
1 parent a595fd88ff
commit fa11ab995c
2 files changed
+105

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
<?php
namespace Bazaar\Controllers;
use Bazaar\Core\Response;
final class AccountController extends Controller
{
public function orders(): Response
{
return $this->view('account.orders', [
'orders' => $this->ctx->orders->forUser($this->ctx->auth->id()),
]);
}
public function show(string $id): Response
{
$order = $this->ctx->orders->findForUser((int) $id, $this->ctx->auth->id());
if ($order === null) {
return $this->notFound();
}
return $this->view('account.order', [
'order' => $order,
'items' => $this->ctx->orders->items((int) $id),
]);
}
}