Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Laravel FormatterNew to Visual Studio Code? Get it now.
Laravel Formatter

Laravel Formatter

rayhan-dev

|
6 installs
| (0) | Free
A fully production-ready Laravel Blade formatter with all known issues resolved.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Laravel Blade Formatter

A production-ready Laravel Blade formatter with advanced Blade parsing and Prettier-level indentation.


✨ Features

  • Advanced Blade directive parsing (@if, @foreach, @section, etc.)
  • HTML + Blade nesting awareness
  • Safe formatting for PHP blocks and echo statements
  • Prettier-like consistent indentation
  • Supports Format on Save
  • Lightweight and fast

📦 Installation

  1. Open VS Code
  2. Go to Extensions (Ctrl + Shift + X)
  3. Search Laravel Blade Formatter
  4. Click Install

Or install manually:

code --install-extension laravel-blade-formatter-0.3.0.vsix

🚀 Usage

Format Document

  1. Open a .blade.php file
  2. Press Shift + Alt + F
  3. Or use Command Palette → Laravel Blade: Format Document

Format on Save

{
  "editor.formatOnSave": true
}

⚙️ Configuration

{
  "laravelBladeFormatter.format.enabled": true,
  "laravelBladeFormatter.format.indentSize": 4,
  "laravelBladeFormatter.format.wrapAttributes": "auto",
  "laravelBladeFormatter.format.wrapLineLength": 120,
  "laravelBladeFormatter.format.endWithNewLine": false,
  "laravelBladeFormatter.format.sortTailwindcssClasses": false,
  "laravelBladeFormatter.format.noMultipleEmptyLines": false,
  "laravelBladeFormatter.format.indentInnerHtml": false
}

🧪 Example

Before:

@if($user)
<div>
<h1>{{ $user->name }}</h1>
@foreach($posts as $post)
<p>{{ $post->title }}</p>
@endforeach
</div>
@endif

After:

@if($user)
    <div>
        <h1>{{ $user->name }}</h1>
        @foreach($posts as $post)
            <p>{{ $post->title }}</p>
        @endforeach
    </div>
@endif

🧑‍💻 Author

Rayhan Bapari

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft