Run php artisan in a different directory

0

How to run the command:

php artisan ...

In a different directory so that the generated files are in the folder I set

    
asked by anonymous 01.06.2018 / 18:01

1 answer

0

This will depend on the command you want to execute, but we assume that you want to execute migration , you can set path (Path) like this:

php artisan migrate --path=/app/database/migrations/relations 

Font

  

1 - Remember that you must in this directory where the file is    artisan
  2 - And the php executable should be in the environment variables

But if you want to execute the command in another folder, just put the complete path of each file, for example:

c:\bin\php.exe c:\meu_projeto\artisan migrate --path=c:\meu_projeto\migrations

In the example, my php executable is in the "bin" folder in the root of c: , while my project is in the "my_project" folder and within "my_project" the migrations .

  

This generates a lot of work, so it is preferable to enter the folder where it is   the artisan file and put the php executable in the variables   environment.

    
01.06.2018 / 18:12