Blade Formatting Arrives in Laravel Pint 1.30.0
Laravel Pint 1.30.0 ships a long-requested feature: first-class formatting support for .blade.php templates. Powered by Prettier and the prettier-plugin-blade plugin, the new Pint/laravel_blade rule brings consistent, automated formatting to your Blade views without requiring a separate toolchain setup.
Enabling Blade Formatting
The quickest way to try it is the new --blade flag:
./vendor/bin/pint --blade
To make it permanent, add the rule to your pint.json:
{
"rules": {
"Pint/laravel_blade": true
}
}
When the rule is disabled (the default), Pint excludes *.blade.php files entirely — exactly the behaviour of every previous release. Enabling it routes only .blade.php files through the Blade formatter, leaving your PHP files on the existing PHP-CS-Fixer pipeline.
Node-Based Formatting and npm Dependencies
Blade formatting runs on Node, not PHP. Before doing any work, Pint checks for three npm packages at the required versions:
prettier(^3.8.4)prettier-plugin-blade(^3.2.2)prettier-plugin-tailwindcss(^0.8.0)
If Node is absent, Pint aborts with a clear explanation. If the packages are missing, Pint detects your package manager, prompts you to install them, and pins each one to the required constraint. If installed versions are out of range, Pint prints the exact install command needed to resolve the mismatch.
What Gets Formatted — and What Doesn't
The formatter handles a wide surface area: Alpine attributes, Livewire wire: bindings, Flux components, Tailwind class sorting, @verbatim blocks, heredocs, inline SVG, and single-file component classes.
Three categories of Blade file are intentionally skipped even when the rule is on, because reformatting them would alter their output or meaning:
- Envoy task files (
Envoy.blade.php,envoy.blade.php) - Boost guideline files under
resources/boost/guidelines/ - Mail views under
resources/views/emails/andresources/views/mail/
Other Improvements in 1.30.0
Renamed files in --diff
The --diff option previously used --diff-filter=AM, silently skipping files that were renamed before pushing. The filter is now --diff-filter=AMR, covering added, modified, and renamed files across committed, staged, and unstaged diff commands.
--quiet writes issues to stderr
--quiet was behaving like --silent, dropping style violations entirely. Issues now go to stderr so stdout stays clean, the exit code still reflects the result, and you can still read the list of offending files.
in key in pint.json
You can now restrict which directories Pint scans directly from pint.json, making it easier to migrate from a .php-cs-fixer.php config without passing paths on the command line every time.
Upgrading
There are no breaking changes. Blade formatting is fully opt-in, and existing configurations continue to work as before. Update via Composer:
composer update laravel/pint
Key Takeaways
- Use
--bladeor"Pint/laravel_blade": trueinpint.jsonto enable Blade formatting. - Formatting is powered by Prettier; Node and three npm packages are required.
- Pint auto-detects your package manager and can install missing dependencies for you.
- Alpine attributes, Livewire bindings, Flux components, and Tailwind class sorting are all supported.
- Envoy, Boost guideline, and mail view files are excluded automatically.
--diffnow correctly handles renamed files with--diff-filter=AMR.--quietnow routes violations to stderr instead of silently dropping them.