Blade Formatting in Laravel Pint

Last updated on by

Blade Formatting in Laravel Pint image

Pint 1.30.0 can format Laravel Blade templates, including blade syntax, Alpine Attributes, Tailwind class sorting, and more. Using the new --blade flag, it enables the configurable Pint/laravel_blade rule that runs your .blade.php files through Prettier and the prettier-plugin-blade plugin.

What's New

Blade Formatting With --blade

Point Pint at a project and add the flag:

./vendor/bin/pint --blade

The flag is a shortcut that toggles the Pint/laravel_blade rule, so you can turn it on permanently in pint.json instead:

{
"rules": {
"Pint/laravel_blade": true
}
}

When the rule is off, Pint excludes *.blade.php from its file finder entirely, which is the behavior every version before this one had. When it is on, only files ending in .blade.php go through the Blade formatter.

Formatting runs on Node, not PHP. The rule requires three npm packages, and Pint checks for them before it does any work:

  • prettier (^3.8.4)
  • prettier-plugin-blade (^3.2.2)
  • prettier-plugin-tailwindcss (^0.8.0)

If Node is missing, Pint aborts with an explanation. If the packages are missing, it detects your package manager, asks whether you want to install them, and installs each one pinned to the required constraint. If they are installed but the versions don't satisfy the constraints, Pint stops and prints the exact install command to fix it.

Three categories of Blade file are skipped even with the rule enabled, because reformatting them changes their output or their meaning:

  • Envoy task files (Envoy.blade.php, envoy.blade.php)
  • Boost guideline files under resources/boost/guidelines/
  • Mail views under resources/views/emails/ and resources/views/mail/

The test suite that shipped with the feature covers Alpine attributes, Livewire wire: bindings, Flux components, Tailwind class sorting, @verbatim blocks, heredocs, inline SVG, and single-file component classes, so the surface it handles is wider than plain HTML indentation.

Renamed Files in --diff

Pint's --diff option ran git diff with --diff-filter=AM, which matches added and modified files but not renames. A file you wrote and then renamed before pushing was silently skipped. The filter is now --diff-filter=AMR across the committed, staged, and unstaged diff commands.

PR: #448 by @MassimilianoLattanzio

--quiet Writes Issues to Stderr

--quiet was behaving like --silent: style violations were dropped rather than redirected. Issues now go to stderr, so stdout stays empty and the exit code still reflects the result, but you can read the list of offending files.

PR: #449 by @lazerg

in Key in pint.json

You can now restrict which directories Pint scans from the config file rather than passing paths on the command line, which makes porting a .php-cs-fixer.php config over more direct.

PR: #454 by @cosmastech

Upgrade Notes

No breaking changes for existing configurations. Blade formatting is opt-in, and with the rule disabled Pint treats .blade.php files exactly as it did before.

Update with Composer:

composer update laravel/pint

References

The source is on GitHub at laravel/pint.

Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Filed in:
Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Acquaint Softtech

Hire Laravel developers with AI expertise at $20/hr. Get started in 48 hours.

Visit Acquaint Softtech
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
No Compromises logo

No Compromises

Joel and Aaron, the two seasoned devs from the No Compromises podcast, are now available to hire for your Laravel project. ⬧ Flat rate of $9500/mo. ⬧ No lengthy sales process. ⬧ No contracts. ⬧ 100% money back guarantee.

No Compromises
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift

The latest

View all →
Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals image

Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals

Read article
Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs image

Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs

Read article
Inertia DevTools Is Now on the Chrome Web Store image

Inertia DevTools Is Now on the Chrome Web Store

Read article
Laravel LSP: A First-Party Language Server Announced at Laracon US 2026 image

Laravel LSP: A First-Party Language Server Announced at Laracon US 2026

Read article
Watch Laracon US 2026 Live on YouTube image

Watch Laracon US 2026 Live on YouTube

Read article
Monthly Log Driver in Laravel 13.23 image

Monthly Log Driver in Laravel 13.23

Read article