Official Laravel SDK

Generate PDFs from Blade.
Use Laravel the way you already do.

Render local Blade views, raw HTML, or published cloud templates with Laravel-native configuration, responses, and downloads.

Laravel 11–13 PHP 8.2+ Native Blade views
Install composer require bladepdf/laravel
InvoiceController.php php
use BladePDF\Laravel\Facades\BladePDF;

return BladePDF::fromView('pdf.invoice', [
    'invoice' => $invoice,
])
    ->format('A4')
    ->showBackground()
    ->render()
    ->download("invoice-{$invoice->number}.pdf");
Laravel SDK

A Laravel-native rendering workflow.

The adapter adds Blade views, framework configuration, response helpers, and webhook integration to the shared BladePDF rendering core.

Blade

Local Blade views

Pass a view name and data to fromView(); Laravel renders the view only when the PDF request is delivered.

Assets

Automatic local files

Resolve referenced files from safe Laravel defaults, including public and storage/app.

Layout

Blade headers and footers

Use withHeader() and withFooter() with separate local views and their own data.

Responses

Laravel delivery helpers

Return inline responses or Unicode-safe downloads directly from controllers.

Async

Queues and webhooks

Submit stored background renders from jobs and validate signed callbacks through the Laravel wrapper.

Templates

Cloud templates

Render published BladePDF templates with context when a document is managed outside the application release.

Blade and local assets

Keep document files in normal Laravel locations.

The package renders the Blade view locally, resolves referenced assets through Laravel-configured roots, and attaches the required files to the render request.

resources/views/pdf/invoice.blade.php blade
<!doctype html>
<html>
<head>
  <link rel="stylesheet"
        href="{{ asset('build/invoice.css') }}">
</head>
<body>
  <img src="{{ asset('images/logo.svg') }}" alt="">
  <h1>Invoice {{ $invoice->number }}</h1>
</body>
</html>

Laravel defaults

public_path() is the document root; public_path() and storage_path('app') are allowed search roots.

Nested stylesheet files

CSS @import and url() dependencies are followed recursively for local fonts and images.

Deferred view rendering

Main, header, and footer Blade views are rendered when render() or async() captures the request.

Constrained filesystem access

base_path() is not allowed by default, and configured roots continue to enforce canonical path boundaries.

Add intentional application roots through the published asset_roots configuration. JavaScript imports, fetch(), runtime URLs, SVG contents, and dependencies inside SVG are not inspected.

Laravel delivery

Return, download, save, or submit.

Choose the result that matches a controller, service, command, or queued job.

response()

Inline response

Return the rendered PDF as a Laravel response with the selected filename and headers.

download()

Download response

Return an attachment response with Unicode-safe filename handling.

save()

Server file

Save the PDF through the shared result object and receive a typed exception on write failure.

storePdf()->async()

Background render

Submit a stored asynchronous render for completion through a signed webhook.

Laravel workflows

Use the package from normal application code.

The facade and factory produce the same fluent PendingRender object across Laravel entry points.

Controllers

Render a Blade view and return response() or download() from a normal controller action.

Services and actions

Inject BladePdfFactory when document creation belongs in a dedicated application service.

Queued jobs

Build stored asynchronous renders in Laravel jobs and handle completion through webhooks.

Scheduled commands

Generate reports and exports from scheduled Artisan commands.

Package capabilities

Laravel conveniences stay at the framework boundary.

Framework-specific behavior is supplied by the adapter while common rendering remains consistent across BladePDF SDKs.

Published configuration

Configure API access, timeouts, retries, TLS behavior, and additional asset roots through Laravel config.

Automatic service discovery

The service provider registers the client, resolver, and factory and supports Laravel package auto-discovery.

Webhook request wrapper

Validate timestamp and signature headers from an Illuminate request while the core verifier handles HMAC validation.

Core exceptions and request ids

Catch BladePDF\Exceptions\BladePdfException and inspect typed transport details when a render fails.

FAQ

Laravel SDK questions.

Can I use my existing Blade views?
Yes. Pass the local view name and its data to fromView(). The view is rendered through Laravel when render() or async() captures the request.
Do local images and stylesheets need public URLs?
No. The configured asset resolver can attach files referenced from public_path(), storage_path('app'), and any additional root you explicitly allow.
Can headers and footers be separate Blade views?
Yes. Use withHeader() and withFooter() with a view name and optional data.
Can I return the result directly from a controller?
Yes. RenderResult adds response() and download() helpers for Laravel HTTP responses.
Does the package support asynchronous renders?
Yes. Call storePdf()->async() and handle completion through a signed webhook.

Render your first Blade view.

Install the Laravel package, configure the API key, and return a PDF from your existing application flow.

composer require bladepdf/laravel