Source: smartupload.medium.com

Running Laravel 7.x/8.x on Heroku
There are quite a few resource available on how to run Laravel on Heroku, but most of them only demonstrate the basics. When moving a fairly complex and big Laravel project to a Heroku infrastructure, you are bound to run into some problems.

To tell Heroku to load extra PHP modules into apache, you need to add them to your composer.json ‘require’ element: The basics are set: we know how to push our local development branch to Heroku, and how to build and release our app.

So I opted for that; and it’s quite simple to switch: For me, the transition to PGSQL was flawless, but if you run into issues I’d love to hear and add solutions to this article.

One of the key characteristics of the Heroku platform is that a Dyno (which is the instance that is executing your Laravel code) has a local filesystem that you cannot rely on to keep your files.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners