solvit.io

Keep Composer packages sorted alphabetically in PHP applications

Solution #1

Add the --sort-packages option when adding new packages in your project:

$ composer require --sort-packages <package-name>
Solution #2

Set the sort-packages option to true in the composer.json file of your project:

{
    "config": {
        "sort-packages": true
    },
    "require": {
        "...": "..."
    }
}
Find more solutions about: ,