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
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
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;
|
||||
@@ -28,11 +29,11 @@ class TicketAdminNotification extends TemplateMailable implements ShouldQueue
|
||||
return [
|
||||
'ticket_num' => $this->ticket->ticket_num,
|
||||
'subject_text' => $this->ticket->subject,
|
||||
'room' => $this->ticket->room ?? 'N/A',
|
||||
'customer_name' => trim($this->customer->firstname . ' ' . $this->customer->lastname) ?: 'N/A',
|
||||
'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' => config('app.frontend_url') . '/tickets/' . $this->ticket->ticket_num,
|
||||
'ticket_url' => MailGlobals::frontendUrl() . '/tickets/' . $this->ticket->ticket_num,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ class InvoiceNotificationMail extends TemplateMailable
|
||||
}
|
||||
|
||||
return '<table style="width: 100%; border-collapse: collapse; margin-top: 16px;" role="presentation" cellspacing="0" cellpadding="0"><tbody><tr>'
|
||||
. '<td style="padding: 14px 16px; border-left: 3px solid #f16723; background-color: #f8fafc; font-size: 13px; line-height: 20px; color: #626262;">'
|
||||
. '<td style="padding: 14px 16px; border-left: 3px solid #f16723; background-color: #f8fafc; font-size: 13px; line-height: 20px; color: #1a1a1a;">'
|
||||
. '<strong style="color: #374151;">Ghi chú:</strong> '
|
||||
. htmlspecialchars((string) $this->invoice->note, ENT_QUOTES, 'UTF-8')
|
||||
. '</td></tr></tbody></table>';
|
||||
|
||||
@@ -107,7 +107,7 @@ class IpAllocationMail extends TemplateMailable
|
||||
->map(fn (string $title) => '<td style="' . self::HEAD_CELL . '">' . $title . '</td>')
|
||||
->implode('');
|
||||
|
||||
return '<table style="border: 1px solid #f6d2b8; border-radius: 10px; border-collapse: separate; overflow: hidden;" role="presentation" width="100%" cellspacing="0" cellpadding="0"><tbody>'
|
||||
return '<table style="' . EmailTemplateShell::TABLE_STYLE . '" role="presentation" width="100%" cellspacing="0" cellpadding="0"><tbody>'
|
||||
. '<tr>' . $head . '</tr>' . $rows
|
||||
. '</tbody></table>';
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Support\EmailTemplateShell;
|
||||
use App\Support\MailGlobals;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
@@ -28,19 +29,14 @@ class TicketCreated extends TemplateMailable implements ShouldQueue
|
||||
|
||||
protected function variables(): array
|
||||
{
|
||||
$room = $this->ticket->room ?? null;
|
||||
$room = $this->ticket->roomLabel();
|
||||
|
||||
return [
|
||||
'full_name' => trim("{$this->customer->firstname} {$this->customer->lastname}") ?: 'Quý khách',
|
||||
'ticket_num' => $this->ticket->ticket_num,
|
||||
'subject' => $this->ticket->subject,
|
||||
'room_row' => $room
|
||||
? EmailTemplateShell::row('Phòng ban', e($room))
|
||||
: '',
|
||||
'ticket_url' => rtrim(config('app.frontend_url', ''), '/') . '/tickets/' . $this->ticket->ticket_num,
|
||||
'app_name' => config('app.name', 'Thế Giới Số'),
|
||||
'support_email' => 'support@tgs.com.vn',
|
||||
'support_phone' => '(028) 7309. 7379',
|
||||
'full_name' => $this->customer->fullname ?: 'Quý khách',
|
||||
'ticket_num' => $this->ticket->ticket_num,
|
||||
'subject' => $this->ticket->subject,
|
||||
'room_row' => $room ? EmailTemplateShell::row('Phòng ban', e($room)) : '',
|
||||
'ticket_url' => MailGlobals::frontendUrl() . '/tickets/' . $this->ticket->ticket_num,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user