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

Laravel Formatter

Rayane Tchabodi

|
6 installs
| (0) | Free
Format PHP files in Laravel projects using Pint
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Laravel Formatter

Version VS Code License: MIT

Format your PHP files in Laravel projects using Laravel Pint directly from VS Code.

✨ Features

  • Format on demand - Use Shift+Alt+F (Windows/Linux) or Shift+Option+F (Mac)
  • Format on save - Automatically format when saving (if editor.formatOnSave is enabled)
  • Auto-detection - Automatically detects Pint in your project's vendor/bin/pint
  • Cross-platform - Works on Windows, macOS, and Linux

📋 Requirements

  • Laravel Pint must be installed in your project:
    composer require laravel/pint --dev
    
  • The extension looks for Pint at ./vendor/bin/pint in your workspace root

🚀 Usage

  1. Open a Laravel project in VS Code
  2. Open any .php file
  3. Format using one of these methods:
    • Press Shift+Alt+F (Windows/Linux) or Shift+Option+F (Mac)
    • Right-click → Format Document
    • Command Palette (Ctrl+Shift+P) → Format Document

Format on Save

Enable automatic formatting on save in your VS Code settings:

{
  "editor.formatOnSave": true,
  "[php]": {
    "editor.defaultFormatter": "rtchabodi.laravel-formatter"
  }
}

⚠️ Error Messages

Message Solution
"No workspace folder found" Open a folder/workspace in VS Code
"Pint not found in vendor/bin/pint" Run composer require laravel/pint --dev

🔧 How It Works

  1. When you request formatting, the extension:

    • Locates vendor/bin/pint in your workspace
    • Creates a temporary copy of your file
    • Runs Pint on the temporary file
    • Applies the formatted result to your document
    • Cleans up the temporary file
  2. Your original file is only modified through VS Code's standard editing mechanism, ensuring undo/redo works as expected.

🛣️ Roadmap

  • [ ] Custom Pint path configuration
  • [ ] Format selection only (range formatting)
  • [ ] Extension icon and branding
  • [ ] Marketplace publication

📝 Release Notes

0.0.1

  • Initial release
  • PHP file formatting using Laravel Pint
  • Auto-detection of Pint binary
  • Windows, macOS, and Linux support

🤝 Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

📄 License

MIT


Enjoy coding with perfectly formatted Laravel code! 🎨

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