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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

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:

  1. PHP formatting — Formats PHP in Livewire SFC sections and @php/@endphp blocks using Laravel Pint
  2. Blade indentation — Auto-indents Blade templates with proper nesting for directives, HTML, components, and Alpine.js attributes
  3. Tailwind class sorting — Sorts Tailwind CSS classes using Prettier with prettier-plugin-tailwindcss

Each formatter can be enabled or disabled independently. Markdown mail templates are never indented, since Markdown renders an indented line as a code block.

Why Not Prettier?

Blade Formatter only changes leading whitespace. It re-indents, but doesn't reflow. Line breaks are left as written.

Other tools, including pint --blade, run Blade through Prettier, which also joins short lines, wraps at a print width, and moves attributes onto their own lines. That works well for plenty of projects. A few reasons Blade Formatter doesn't:

Mostly this is preference. If you'd rather have full reflow, pint --blade does it well.

Skipped Files

Some Blade files are never formatted, because reformatting them would change what they do rather than just how they look:

File Why
Envoy.blade.php, envoy.blade.php Indentation inside @task is passed through to the shell
resources/boost/guidelines/** Whitespace-sensitive Markdown
Templates using an <x-mail::> component, and anything under vendor/mail Whitespace-sensitive Markdown mail

These are skipped even when named explicitly on the command line.

Mail templates are a partial case: only indentation is skipped. Pint and Tailwind sorting still run, since neither changes the whitespace Markdown reads.

Opting Out

Wrap a region in blade-formatter-disable / blade-formatter-enable comments to leave it byte-for-byte unchanged. Everything outside the region is still formatted:

Omit the closing comment to opt out the rest of the file. Put one at the top and the whole file is skipped.

Class attribute order never affects CSS, so Tailwind sorting is normally safe everywhere, including inside @verbatim where Vue and Handlebars templates genuinely want it. The exception is markup that is itself the content: documentation pages showing code samples, or fixtures asserted against as strings. Sorting rewrites the example you are demonstrating, even when it is HTML-escaped inside <pre>.

Requirements

Installation

The VS Code extension requires the Laravel extension.

Usage

Configuration

Create a blade-formatter.json in your project root:

exclude takes a path substring or a delimited regex, matched relative to the working directory, and applies to every run mode — including --diff, --dirty, and paths named on the command line. flux/icon, vendor/mail, and vendor/notifications are always excluded.

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.runOnSave enabled, Pint will strip use statements 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

PHP Build Version
Package Version
Requires php Version ^8.2
ext-json Version *
ext-mbstring Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package joelstein/blade-formatter contains the following files

Loading the files please wait ...