Files
portal-api/app/Mail/Admin/TicketAdminNotification.php
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

40 lines
1.2 KiB
PHP

<?php
namespace App\Mail\Admin;
use App\Mail\TemplateMailable;
use App\Support\MailGlobals;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\SerializesModels;
class TicketAdminNotification extends TemplateMailable implements ShouldQueue
{
use Queueable, SerializesModels;
public function __construct(
public readonly mixed $ticket,
public readonly mixed $customer,
) {}
protected function scenario(): string
{
return 'admin_ticket_notification';
}
protected function variables(): array
{
$description = strip_tags($this->ticket->description ?? '');
return [
'ticket_num' => $this->ticket->ticket_num,
'subject_text' => $this->ticket->subject,
'room' => $this->ticket->roomLabel() ?? 'N/A',
'customer_name' => $this->customer->fullname ?: 'N/A',
'customer_email'=> $this->customer->email,
'description' => mb_substr($description, 0, 500) . (mb_strlen($description) > 500 ? '…' : ''),
'ticket_url' => MailGlobals::frontendUrl() . '/tickets/' . $this->ticket->ticket_num,
];
}
}