DEV Community

Discussion on: Deploy Laravel application with database to Heroku

Collapse
 
iamhabbeboy profile image
Azeez Abiodun Solomon

Thanks for sharing this 🤝, but instead of doing this

On your laravel app go to config/database.php file, and put this code on the top.

$DATABASE_URL=parse_url(‘DATABASE_URL’);
Change DATABASE_URL to the url on your heroku config.
Enter fullscreen mode Exit fullscreen mode

Why not add them to environment variable on Heroku, I guess that much better and neater. It works for me though ☺️.

Collapse
 
safventure11000 profile image
Josafe Balili • Edited

Yep! Actually, this was mentioned in the other comments but I wasn't able to find time to update my blog. Now that you gave me this, I will go ahead and update it. Thanks for sharing.