Adding composer repository via command line
Today I was installing laravel nova and discovered a command in the installation process that was new to me.
1composer config \2 repositories.nova \3 '{"type": "composer", "url": "https://nova.laravel.com"}' \4 --file composer.json
It adds the composer repository to your composer.json file without having to manually edit the file. In the past I've always fired up sublime text to make these edits by hand.
1composer config \2 repositories.treasure \3 '{"type": "composer", "url": "https://treasure.cove.no"}' \4 --file composer.json
Written by Eivin Landa • December 9, 2021 • Updated March 24, 2022