Skip to content
Laravel Fmt is in public beta. Found a bug? Open an issue →
Introduction  /  Getting started
Edit this page

Getting started

Install Laravel Fmt and format your first Laravel file.

beta

Laravel Fmt is in public beta and not recommended for production code yet.

Install

Terminal
composer require jacobjoergensen/laravel-fmt --dev
Requires PHP 8.3+.

Format your project

Run it with no arguments to format the whole project, or pass paths.

Terminal
# format the whole project
vendor/bin/laravel-fmt

# format specific paths
vendor/bin/laravel-fmt app/Models resources/views

See What it formats for the full list of supported languages.

Check without writing

--check lists the files that would change. --diff shows the changes. Neither writes anything.

Terminal
vendor/bin/laravel-fmt --check
vendor/bin/laravel-fmt --diff

Configuration

No config file is needed. init writes a laravel-fmt.json you can edit.

Terminal
vendor/bin/laravel-fmt init

Your existing Pint, PHP-CS-Fixer, Mago, EditorConfig, and Prettier config is read too. See Existing config files.