Skip to content

Instantly share code, notes, and snippets.

@Ademking
Last active August 8, 2020 04:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ademking/b60fd95779979d5a9e536a29dfb0d7ef to your computer and use it in GitHub Desktop.
Save Ademking/b60fd95779979d5a9e536a29dfb0d7ef to your computer and use it in GitHub Desktop.
Heroku Notes

How to add heroku app to existing project

heroku git:remote -a HEROKU_APP_NAME_HERE

Heroku deployment without the app being at the repo root (in a subfolder)

git add .
git commit -m "First Commit"
git subtree push --prefix NAME_OF_SUBFOLDER_HERE heroku master

Remove heroku from existing project

git remote rm heroku 

Laravel + Heroku

  1. Create Procfile and add :
web: vendor/bin/heroku-php-apache2 public
  1. run :
heroku git:remote -a HEROKU_APP_NAME_HERE
git add .
git commit -m "your message"
git push heroku master
  1. go to Heroku -> settings -> Reveal config vars
  2. Create APP_KEY : base64.......... (from .env file)
  3. To add database we will use PostGres : go to Heroku -> Resources -> Add-ons -> postgres
  4. Go to Heroku -> settings -> Reveal config vars and you will find DATABASE_URL postgres://:@:/
  5. Config will look like this Demo
  6. run
heroku run bash
php artisan migrate:fresh

More info : https://medium.com/@sdkcodes/how-to-deploy-a-laravel-app-to-heroku-24b5cb33fbe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment