Introduction / Getting started
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 --devRequires 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/viewsSee 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 --diffConfiguration
No config file is needed. init writes a laravel-fmt.json you can edit.
Terminal
vendor/bin/laravel-fmt initYour existing Pint, PHP-CS-Fixer, Mago, EditorConfig, and Prettier config is read too. See Existing config files.