skip to Main Content

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.

enter image description here

3

Answers


  1. 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 plain php 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).

    Login or Signup to reply.
  2. 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.

    If, for some reason, it couldn’t write to the hard drive (permissions, storage, corrupted sector, etc.), then … you should have received an error message. The code I referred to is quite simple and should work as expected.


    Source: comment under the question

    When do we receive neither an error message nor a result?

    … it was interrupted the first time (for example, you stopped it in the terminal, so you didn’t get an error, but the result didn’t come out either).


    Source: comment under the question

    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.).

    What about SIGINT (interrupt)?

    This is the signal sent via CTRL + C. It’s typically only used in an interactive terminal – when we’re at our keyboard (for local development or for those 1-off tasks in production you really should automate).

    You’ll notice that SIGINT isn’t listened for in Laravel’s queue worker! Instead, that’s handled by PHP, and it just quits whatever happens to be running. It is, therefore, not a way to gracefully exit a process!


    Source: Handling signals in Laravel

    More information

    Login or Signup to reply.
  3. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search