Laravel locally manages wizard commands, affects the VM environment

I am looking for a solution that will allow me to run artisan commands from my local machine and take effect from my homestead VM.

For example, when you run php artisan migrate command is launched using the information stored in the .env files on the virtual machine, but my terminal tries to run them locally.

Most commands run successfully because they do not need drivers from the remote machine. Running php artisan route:list works fine.

How to run artisan commands using a local terminal?

0
source share
1 answer

You need to modify the following files:

.env

 DB_HOST=127.0.0.1 DB_HOST_PORT=:33060 

homestead.yaml

 variables: - key: APP_ENV value: local - key: DB_HOST_PORT value: ":3306" 

config /database.php

 'mysql' => [ // ... 'driver' => 'mysql', 'host' => env('DB_HOST') . env('DB_HOST_PORT'), // ... ] 
+4
source

Source: https://habr.com/ru/post/1203846/


All Articles