Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 8 dev project with Laravel Sail and versioning

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?

like image 639
bwarff Avatar asked Oct 15 '25 01:10

bwarff


1 Answers

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.

like image 76
malte.h Avatar answered Oct 17 '25 16:10

malte.h