I using Laravel Sail. When I add composer packages I do it in the project folder with composer require .../...
. But right now I’m wondering if it’s better to do it directly in the docker container. So ./vendor/bin/sail composer require .../...
?
Note: Because I always have the latest PHP and node version installed on my system and therefore haven’t had any problems so far. But if I work on a computer without PHP then I have to load the dependencies within the container.
2
Answers
I use the command
sail bash
and then I can run all artisan and composer commands from the cli inside the container.After you download your Laravel application, run the following command to have sail available within your project as seen in the official Laravel’s documentation: