Following the documentation, I tried to run php artisan lang:publish
but it generates an empty lang folder. I would expect there will be at least messages.php
file for English. Can somebody tell me why it is empty? I run the command in docker terminal but it is empty in docker container and also in computer disk.
3
Answers
Seems like you have some problems with the mount syncronization between your Docker volume and your file system.
Try to run the command either inside the Docker container (
docker compose exec <app_name> php artisan lang:publish
) and outside it (just plainphp artisan lang:publish
) and see what happens.Anyway, it’s better to provide some additional context in such questions. Like run command, it’s output, and contents of
storage/logs/laravel.log
(maybe it contains some exceptions).The command was introduced in laravel/framework PR #45902 without further modifications.
You ran the command, but didn’t receive an error message or any result.
When do we receive neither an error message nor a result?
So, if an command is started and then unexpectedly interrupted, the code will stop immediately, and therefore no error message will be generated about the operation not being completed.
Just for the record: Such a sudden stop can be caused by closing the terminal, interrupting the command execution (e.g., CTRL + C), or other shutdown-related issues (power outage, reboot, etc.).
More information
do you have write permission to the
lang
folder?also, please check if the
vendor/laravel/framework/src/Illuminate/Translation/lang
has content in it.
not a solution but a workaround: you can actually manually copy files from
vendor/laravel/framework/src/Illuminate/Translation/lang
to your
resources/lang
folder.