Files
portal-api/app/Http/Resources/Api/Client/Ticket/ClientTicketResource.php
T
baodev0 0b08689ea4 feat: harden admin auth and ticket workflows
- add rotating admin refresh tokens and password gates\n- expand ticket galleries, exports, and client resources\n- improve IP allocation auditing and dashboard data\n- enforce encrypted client access tokens on public routes
2026-10-16 17:00:55 +07:00

28 lines
974 B
PHP

<?php
namespace App\Http\Resources\Api\Client\Ticket;
use App\Support\TicketGallery;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class ClientTicketResource extends JsonResource
{
public function toArray(Request $request): array
{
return [
'ticket_num' => $this->ticket_num,
'subject' => $this->subject,
'description' => $this->description,
'status' => $this->status,
'room' => $this->room,
'priority' => $this->resource->priority(),
'gallery' => TicketGallery::clientUrls($this->resource),
'customer' => $this->whenLoaded('customer', fn () => ['fullname' => $this->customer->fullname]),
'replies' => ClientTicketReplyResource::collection($this->whenLoaded('reply')),
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
];
}
}