adrema/app/Invoice/Actions/DisplayPdfAction.php

21 lines
419 B
PHP
Raw Normal View History

2023-12-17 22:33:29 +01:00
<?php
namespace App\Invoice\Actions;
use App\Invoice\BillDocument;
use App\Invoice\Models\Invoice;
use Illuminate\Http\Response;
use Lorisleiva\Actions\Concerns\AsAction;
use Zoomyboy\Tex\BaseCompiler;
use Zoomyboy\Tex\Tex;
class DisplayPdfAction
{
use AsAction;
public function handle(Invoice $invoice): BaseCompiler|Response
{
return Tex::compile(BillDocument::fromInvoice($invoice));
}
}