Laravel Pint 1.30 Adds Blade Template Formatting via Prettier
Laravel Pint 1.30.0 introduces opt-in formatting of Blade templates through a new --blade flag, powered by Prettier and dedicated Blade and Tailwind plugins.
The release also fixes --diff rename handling, redirects --quiet output to stderr, and adds an "in" config key.
Laravel Pint 1.30.0 can now format Blade templates. The headline feature is a new --blade flag that activates the configurable Pint/laravel_blade rule, sending .blade.php files through Prettier with the prettier-plugin-blade plugin. Instead of passing the flag, the rule can be enabled permanently via pint.json: "rules": { "Pint/laravel_blade": true }.
The rule is opt-in. When disabled, Pint excludes *.blade.php from its file finder entirely, matching the behavior of all previous versions; when enabled, only .blade.php files go through the Blade formatter.
Formatting runs on Node.js, not PHP. The rule requires three npm packages with pinned constraints: prettier (^3.8.4), prettier-plugin-blade (^3.2.2) and prettier-plugin-tailwindcss (^0.8.0). Pint checks for them before doing any work: if Node is missing it aborts with an explanation; if the packages are missing it detects the package manager, asks for confirmation, and installs each one pinned to the required constraint; if versions don't satisfy the constraints, it stops and prints the exact install command to fix the situation.
Three categories of Blade files are skipped even with the rule enabled, because reformatting would change their output or meaning: Envoy task files (Envoy.blade.php, envoy.blade.php), Boost guideline files under resources/boost/guidelines/, and mail views under resources/views/emails/ and resources/views/mail/.
The feature's test suite covers Alpine attributes, Livewire wire: bindings, Flux components, Tailwind class sorting, @verbatim blocks, heredocs, inline SVG, and single-file component classes, going well beyond basic HTML indentation.
The release ships three smaller improvements. First, --diff previously ran git diff with --diff-filter=AM, silently skipping renamed files; the filter is now --diff-filter=AMR across committed, staged, and unstaged diff commands (PR #448 by @MassimilianoLattanzio). Second, --quiet no longer behaves like --silent: style violations now go to stderr, so stdout stays clean while the offending files remain readable, and the exit status is unaffected (PR #449 by @lazerg). Third, a new "in" key in pint.json lets projects restrict which directories Pint scans from the config file instead of passing paths on the command line, easing migration from a .php-cs-fixer.php config (PR #454 by @cosmastech).
There are no breaking changes; existing configurations keep working, and .blade.php files are treated exactly as before when the rule is off. Update with composer update laravel/pint. References: the v1.30.0 release on GitHub, the v1.29.3...v1.30.0 changelog, and the Blade support implementation commit fefd4035.
Readers’ Forum
No contributions yet — open the debate.
Open the discussion
No account or password needed — just enter your e-mail and we’ll send you a one-time sign-in link. First time here? You’re set up automatically.
Your rating will be applied automatically after you sign in.
Check your inbox
We’ve sent a sign-in link to …. Open it on this device — this tab will sign you in automatically.
Waiting for your click …
·