Upgrade the Laravel package to 2.0
Laravel 2.0 keeps normal facade calls intact and delegates framework-independent behavior to bladepdf/php. It requires PHP 8.2+ and Laravel 11-13.
Composer update
1composer require bladepdf/laravel:^2.0 --with-all-dependencies 1composer require bladepdf/laravel:^2.0 bladepdf/spatie-laravel-pdf-driver:^2.0 --with-all-dependenciesFacade calls stay the same
BladePDF::fromView(), fromHtml(), fromTemplate(), fluent options, render(), and response/download helpers retain their normal call sites. Blade views, headers, and footers are now rendered only when the request is submitted.
Namespace changes
| 1.x | 2.x |
|---|---|
BladePDF\Laravel\Exceptions\BladePdfException | BladePDF\Exceptions\BladePdfException |
BladePDF\Laravel\Exceptions\RenderFailedException | BladePDF\Exceptions\RenderFailedException |
BladePDF\Webhooks\SignatureValidator | BladePDF\Laravel\Webhooks\SignatureValidator |
BladePDF\Laravel\RenderSubmission | BladePDF\RenderSubmission |
The internal Laravel HTTP client and BladePDF\Laravel\Support\* classes were removed. Bind or fake BladePDF\Contracts\RenderClient and inspect BladePDF\RenderRequest instead.
Review asset roots
Laravel allows automatic files only from public_path() and storage_path('app') by default. base_path() is intentionally excluded so rendered HTML cannot read .env or application source. Publish the config and add narrowly scoped directories to asset_roots when required.
1'asset_roots' => [
2 public_path(),
3 storage_path('app'),
4 storage_path('tenants/pdf-assets'),
5],An explicit withAsset() remains the escape hatch for one caller-approved file outside these roots. Automatic traversal and symlink escapes now fail with AssetAccessDeniedException.
Spatie compatibility
Spatie driver 1.x belongs with Laravel package 1.x. Spatie driver 2.x belongs with Laravel package 2.x and continues to use the driver name bladepdf.