Hi,
Not sure if you managed to get your original issue working, but the problem is how the app is configured to work with Heroku.
As you know, Heroku uses its own config vars to deliver the database details which sort of makes the 'dot' ENV file method obsolete, or at least annoying if you are using it because you have two places to store ENV vars.
This is fine when your actual app is interacting with the database, as the server vars have been parsed and initialised correctly, but fails when Artisan is run because it can't get the 'host' variable, as defined in the 'config/database.php' file, because the 'DATABASE_URL' ENV var has not been set.
My awful (and temporary) solution to this, was to update Artisan with a hardcoded 'DATABASE_URL' at the top of the file
putenv("DATABASE_URL=...);
This worked, and stopped the error, but it's obviously not the right solution. I'd be interested to hear if you or anyone else has the right solution, as i have no idea how to give Artisan the right details without using the 'dot' ENV file method
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community