update fix deadcode, security

This commit is contained in:
baodev0
2026-09-28 08:26:29 +07:00
parent 3af59bd9c5
commit 82080b5b84
452 changed files with 4857 additions and 26289 deletions
@@ -325,22 +325,6 @@ class EmailTemplateController extends Controller
->all();
}
// ── Invoice PDF preview ───────────────────────────────────────────────────
public function previewInvoiceJson(int $id): JsonResponse
{
$template = Template::findOrFail($id);
if ($template->scenario !== 'invoice_pdf' || $template->format !== 'json') {
return response()->json(['error' => true, 'message' => 'Template này không phải invoice JSON.'], 422);
}
$config = json_decode($template->message ?? '{}', true);
// Return the config + blade HTML preview
$html = view('pdf.invoice-preview', compact('config'))->render();
return response()->json(['error' => false, 'html' => $html]);
}
// ── Helpers ───────────────────────────────────────────────────────────────
private function format(Template $t): array