Lavarel Heroku 500 Error

UPDATE: 01/21/2024 - you can use the cli command to update these variables:

$ heroku config:set APP_KEY='base64:o9gwTlxCj4HJ39/Ubpx0...' // Get this from .env file in Laravel
$ heroku config:set APP_DEBUG='true'

Alternate fix:

To fix a 500 error on  your Laravel Application, follow these instructions:

This is because you have not setup the a key, we will setup the configurations with a command.

NOTE: you can get these values from the .env file.

heroku config:add APP_NAME=Laravel
heroku config:add APP_ENV=production
heroku config:add APP_KEY=[APP_KEY VALUE from .env]
heroku config:add APP_DEBUG=true
heroku config:add

If you don't have any of these Key values, the main configuration causing the 500 error is the APP_DEBUG and APP_KEY - you must provide atleast these two to resolve the 500 error.

Or you can do this without a command with the following steps:

First thing to do is to go to your Heroku Dashboard:

a. click on the application name you just created
b. click on the settings tab
c. under the Config Vars section, click on the "Reveal Config Vars" button
d. Populate each field as follows from the .env file in your app

VALUE: base64:3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
lick the "Add" button

NOTE: the APP_KEY can be found in your .env file

VALUE: true
* Set to true so you can debug your app, otherwise, set to false on production apps

Refresh your browser to
This time you will see your application and not the 500 error