Visitor management app with SSO, kiosk, badges, reports, and Gitea CI deploy to frontdesk.ladill.com. Co-authored-by: Cursor <cursoragent@cursor.com>
29 lines
648 B
PHP
29 lines
648 B
PHP
<?php
|
|
|
|
namespace App\Services\Printers;
|
|
|
|
use App\Contracts\Printers\PrinterDriverInterface;
|
|
use App\Models\Visit;
|
|
use App\Services\Frontdesk\BadgeRenderService;
|
|
|
|
class PdfPrinterDriver implements PrinterDriverInterface
|
|
{
|
|
public function name(): string
|
|
{
|
|
return 'pdf';
|
|
}
|
|
|
|
public function renderBadge(Visit $visit): array
|
|
{
|
|
$visit->load(['visitor', 'host', 'organization']);
|
|
|
|
$html = app(BadgeRenderService::class)->renderHtml($visit, true);
|
|
|
|
return [
|
|
'format' => 'html',
|
|
'content' => $html,
|
|
'filename' => 'badge-'.$visit->badge_code.'.html',
|
|
];
|
|
}
|
|
}
|