An opinionated formatter for Laravel Blade templates
open sourceMITfree
An opinionated formatter for Laravel's Blade templates by Shuhei Hayashibara, written because Blade has no official formatter. It indents markup inside directives, adds spacing to Blade markers, formats PHP inside directives to PSR-2 (with PHP 8 syntax), supports custom directives and can sort Tailwind CSS classes. It runs as a CLI and a Node library, and as the Laravel Blade formatter extension for VS Code. MIT licensed.
Problems it solves
- format Laravel Blade templates automatically
- keep Blade views consistently indented across a team
- sort Tailwind classes in Blade files on save
Features
- indents markup inside Blade directives
- spacing around Blade markers
- PSR-2 formatting of PHP inside directives
- PHP 8 syntax support
- Tailwind CSS class sorting
- custom directive support
- CLI, Node library and VS Code extension
