Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
1) Create a new laravel instalation
-> composer create-project laravel/laravel
Or just use an existing project
2) Create a file named Procfile (without extension) in root laravel folder
2.1) Add this line:
-> web: vendor/bin/heroku-php-apache2 public
3) Install Heroku Toolbelt
-> https://devcenter.heroku.com/articles/getting-started-with-php#set-up
4) Initialize repository
-> git init
-> git add -A && git commit -m "Initial commit"
5) Create the Heroku app (forcing eu region)
-> heroku create --region eu
6) Allowing Heroku to recognize PHP installation
-> heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-php
7) Deploy your code to the Heroku app
-> git push heroku master
8) Instead add all the .env variables 1 by 1, install this plugin to that job for us:
-> heroku plugins:install git://github.com/ddollar/heroku-config.git
9) Then just add the .env correctly and run the followin command:
-> heroku config:push
10) Install all the dependencies:
-> heroku run composer update
-> heroku run php /app/artisan migrate:refresh
Extras:
Force app rebuild (empty push)
-> git commit --allow-empty -m "empty commit"
-> git push heroku master
ref:
https://mattstauffer.co/blog/installing-a-laravel-app-on-heroku
https://devcenter.heroku.com/articles/getting-started-with-php
https://samypesse.gitbooks.io/heroku-node/content/configuration.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment