I'm learning Laravel 8, and I want to set up a quick dev environment using Laravel Sail.
Since we usually don't commit to the vendor directory in Git, how can we run Sail from a fresh Git clone? We can't use "composer install" without it. Does it mean we should commit the vendor/bin and vendor/composer folders? What are the common practices about it?
Should we commit /vendor/bin to git for a fresh dev environment out of the box?
I have stumbled across the exact same problem. In the documentation there is the following section solving that:
You may install the application's dependencies by navigating to the application's directory and executing the following command. This command uses a small Docker container containing PHP and Composer to install the application's dependencies:
docker run --rm \
-u "$(id -u):$(id -g)" \
-v $(pwd):/var/www/html \
-w /var/www/html \
laravelsail/php81-composer:latest \
composer install --ignore-platform-reqs
https://laravel.com/docs/8.x/sail#installing-composer-dependencies-for-existing-projects
Of course you also have to prepare the .env-File and other not commited dependencies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With