Download the PHP package joelstein/blade-formatter without Composer
On this page you can find all versions of the php package joelstein/blade-formatter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package blade-formatter
Blade Formatter
A tool that formats Blade templates and Livewire Single File Components. Like Laravel Pint for Blade — run a single command and your files are clean. Includes a VS Code extension with format-on-save and automatic PHP/Blade language switching.
What It Does
Blade Formatter runs three formatters in sequence:
- PHP formatting — Formats PHP in Livewire SFC sections and
@php/@endphpblocks using Laravel Pint - Blade indentation — Auto-indents Blade templates with proper nesting for directives, HTML, components, and Alpine.js attributes
- Tailwind class sorting — Sorts Tailwind CSS classes using Prettier with prettier-plugin-tailwindcss
Each formatter can be enabled or disabled independently. Markdown mail templates (<x-mail::message>) are automatically skipped to preserve whitespace-sensitive formatting.
Requirements
- PHP 8.2+
- Node.js (for Tailwind class sorting)
Installation
The VS Code extension requires the Laravel extension.
Usage
Configuration
Create a blade-formatter.json in your project root:
VS Code Extension
The extension provides format-on-save and automatic PHP/Blade language switching in Livewire SFCs. All settings are under bladeFormatter.*:
| Setting | Default | Description |
|---|---|---|
enable |
true |
Enable or disable the extension |
formatOnSave |
true |
Format Blade files on save |
enableLanguageSwitching |
true |
Switch PHP/Blade language modes in SFCs |
executablePath |
"" |
Custom path to blade-format binary |
Formatting options (indent size, enable/disable formatters, etc.) are configured in blade-formatter.json — not in VS Code settings. This keeps CLI and editor output consistent.
Note: If you use the Laravel Pint VS Code extension with
Laravel.pint.runOnSaveenabled, Pint will stripusestatements from SFCs that are only referenced in Blade — undoing the blade formatter's work. Disable Pint's run-on-save for Blade files in your.vscode/settings.json:
CI Integration
License
MIT
All versions of blade-formatter with dependencies
ext-json Version *
ext-mbstring Version *