DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Steve Mak
Steve Mak

Posted on

Cheatsheet for Composer

Reference

Download & Install composer locally

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '8a6138e2a05a8c28539c9f0fb361159823655d7ad2deecb371b04a83966c61223adc522b0189079e3e9e277cd72b8897') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
Enter fullscreen mode Exit fullscreen mode

Check composer version

./composer.phar --version
Enter fullscreen mode Exit fullscreen mode

Create a new project based on existing repository

./composer create-project --prefer-dist laravel/laravel .
Enter fullscreen mode Exit fullscreen mode

Make directory writable within the Laravel application

1) storage
2) bootstrap/cache

Top comments (0)

Hi!I'm Noah!

Hey, my name is Noah and I’m the one who set up this ad!


My job is to get you to join DEV, so if you fancy doing me a favor, I’d love for you to create an account.
Β 
If you found DEV from searching around, here are a couple of our most popular articles on DEV: