$ echo web: vendor/bin/heroku-php-apache2 public/ > Procfile
Create a Heroku App:
$ heroku create
Or link project to existing Heroku App:
$ git remote add heroku git@heroku.com:<app-name>.git
Change <app-name>
to your Heroku App name
Add a PostgreSQL Database
$ heroku addons:create heroku-postgresql:hobby-dev
Go to https://dashboard.heroku.com/apps and click on your Application.
Click on the Installed add-ons
-> Heroku Postgres
From the new website, click on Settings
-> View Credentials
to see database credentials
Go back to the website https://dashboard.heroku.com/apps/ and click on Settings
-> Reveal Config Vars
Add the following to the config vars:
DB_CONNECTION
-> pgsql
DB_DATABASE
-> Database from Database Credentials
DB_HOST
-> Host from Database Credentials
DB_PASSWORD
-> Password from Database Credentials
DB_PORT
-> Port from Database Credentials
DB_USERNAME
-> User from Database Credentials
Run php migrations
$ heroku run php /app/artisan migrate
Or you can use heroku bash to migrate
$ heroku run bash
$ php artisan migrate