japseyz/pdf-renderer

1.2.1 2024-11-22 20:54 UTC

README

Installation

You can install the package via composer:

composer require japseyz/pdf-renderer

You can publish the config file with:

php artisan vendor:publish --tag="pdf-renderer-config"

This is the contents of the published config file:

return [
    // Possible values are:
    // 'browsershot', 'api2pdf'
    'service' => 'browsershot'
];

Usage

 $renderer = PDFRenderer::view(
    'documents.invoice',
    [
        'client'          => $client,
    ]
);

return response($renderer->render(), 200, [
    'Content-Type'        => 'application/pdf',
    'Content-Disposition' => 'attachment; filename="invoice.pdf"',
]);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.