reliese / laravel

Reliese Laravel Model Generator
MIT License
1.48k stars 316 forks source link

Laravel 6 - database config not being picked up from .env file #155

Closed seanatdss closed 4 years ago

seanatdss commented 4 years ago

I am following the directions from this article: https://medium.com/@CristianLLanos/eloquent-models-from-my-database-5d74c632e03c#.qg7cd4vri

I have set up a local database for testing and have moved a complex schema without data from a production environment When I run the php artisan code:models it throws the following error: SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' But that is not the configuration for the mysql database access in he .env file. For mysql, the .env file contains: DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=mysae DB_USERNAME=laravel and a DB_PASSWORD entry.

Why is the reliese code not picking up and using the .env database configuration?

Thank you,

CristianLlanos commented 4 years ago

This bug is unrelated to this package. This has more to do with your Laravel/Lumen setup.

CristianLlanos commented 4 years ago

If you are using Lumen, don't forget to register your database configurations adding to your bootstrap/app.php file the folowing line:

$app->configure('database');
seanatdss commented 4 years ago

Yeah - my bad - thank you - I am running into a different issue which I will open a different issue for,