Skip to content

How to Deploy Easy Restaurant on Heroku

  • by

This guide explains how to deploy Easy Restaurant on Heroku for demonstrations, testing, and staging environments.

Prerequisites

Before deploying Easy Restaurant, make sure you have:

  • The Heroku CLI installed
  • Git installed
  • The Easy Restaurant project in a Git repository
  • A Procfile included with the project

Step 1 — Log In to Heroku

Open your terminal and run:

heroku login

Log in using your Heroku account.

Step 2 — Create the Easy Restaurant Heroku App

Create a new application:

heroku create easy-restaurant-demo

This creates a Heroku application for Easy Restaurant.

Step 3 — Add a MySQL Database

Add the MySQL add-on:

heroku addons:create jawsdb:kitefin

Retrieve the database connection information:

heroku config | grep JAWSDB_URL

Record the values required for the Easy Restaurant database configuration.

Step 4 — Configure Easy Restaurant Environment Variables

Set the production environment:

heroku config:set APP_NAME="Easy Restaurant"
heroku config:set APP_ENV=production
heroku config:set APP_DEBUG=false
heroku config:set APP_URL=https://easy-restaurant-demo.herokuapp.com

Generate and set the application key:

heroku config:set APP_KEY=$(php artisan key:generate --show)

Configure the MySQL connection:

heroku config:set DB_CONNECTION=mysql
heroku config:set DB_HOST=<host-from-jawsdb>
heroku config:set DB_PORT=3306
heroku config:set DB_DATABASE=<dbname-from-jawsdb>
heroku config:set DB_USERNAME=<user-from-jawsdb>
heroku config:set DB_PASSWORD=<pass-from-jawsdb>

Configure Laravel logging for the Heroku environment:

heroku config:set LOG_CHANNEL=stderr

Add any other environment variables required by Easy Restaurant.

Step 5 — Deploy Easy Restaurant

From the Easy Restaurant project directory, deploy the application:

git push heroku main

Heroku will build and deploy the Easy Restaurant application.

Step 6 — Run Easy Restaurant Migrations

Run the Laravel migrations:

heroku run php artisan migrate --force

Seed the administrator data:

heroku run php artisan db:seed --class=SuperAdminSeeder

Seed the demo tenant data:

heroku run php artisan db:seed --class=DemoTenantSeeder

Optimize Easy Restaurant:

heroku run php artisan optimize

Step 7 — Open Easy Restaurant

Open the deployed application:

heroku open

Your Easy Restaurant installation should now load in the browser.

Important File Storage Consideration

Heroku uses an ephemeral filesystem. Files uploaded to the application, including media managed by Easy Restaurant, should not be stored permanently on the local Heroku filesystem.

For production use, configure Easy Restaurant to use Amazon S3 or another persistent object-storage service.

For example, configure:

FILESYSTEM_DISK=s3

and provide the required AWS S3 credentials through Heroku configuration variables.

The Easy Restaurant project should use the existing S3 filesystem integration included in its Composer dependencies.