This is a fairly quick fix luckily, sail
has a limited list of commands that it can run directly.
You can see what they are by looking inside vendor/bin/sail
(it's a text file) or just running ./vendor/bin/sail
directly. Laravel have added many, such as up
, down
, artisan
, test
, shell
, composer
, npm
, and so on.
If the command is not supported by sail
, it will pipe it through to the docker-compose
command.
In this case the envoy
and vendor/bin/envoy
commands you tried to run are not valid docker-compose
commands, so instead it fails and shows you the full list of Docker Compose commands.
Workaround
Try this instead:
sail exec laravel.test php vendor/bin/envoy run envoy-task
This will exec
(run/execute) the command inside one of your containers (typically named laravel.test
but you may have changed this in your docker-compose.yml
).
The command itself is php vendor/bin/envoy run envoy-task
.
The format is:
sail exec <service> <command>
Simplification
If you find you need to run a lot of envoy
commands inside sail
and the above command is too long, you can create a ./envoy
bash script with something like this:
vendor/bin/sail exec laravel.test php vendor/bin/envoy run "${@:1}"
Then it should be as simple as running: ./envoy envoy-task
which will run envoy-task
inside your container.