Skip to content

Instantly share code, notes, and snippets.

@leantony
Created November 21, 2015 09:21
Show Gist options
  • Save leantony/b52664762f1d00a69c28 to your computer and use it in GitHub Desktop.
Save leantony/b52664762f1d00a69c28 to your computer and use it in GitHub Desktop.
heroku laravel tutorial

#STEP 1 Create a new laravel project. For more info, check the laravel docs page, on the laravel website

composer create-project laravel/laravel --prefer-dist my-laravel-app

#STEP 3 Install heroku toolbelt, on your machine. Assuming its ubuntu, just follow the following instructions Heroku toolbelt is a command line client, for heroku

sudo apt-get install heroku

For more info, visit how to install heroku toolbelt

#STEP 2 Initialize an empty git repo in the root of the project folder, and make your first commit

git init
git add -A
git commit -m "initial commit"

#STEP 3 push the project to github Check the guide here

git push -u origin master

#STEP 4 Create heroku procfile, at the root of your project This procfile, will instruct heroku to serve up apache from the public folder Once youve done this, commit the file

echo "web: vendor/bin/heroku-php-apache2 public/" > Procfile
git add .
git commit -m "Added procfile for Heroku"
git push -u origin master

#STEP 5 Create heroku app

heroku create

#STEP 6 Declare a heroku buildpack, for your project. If you skip this part, your project will be detected by heroku as a nodejs project

heroku buildpacks:set heroku/php

#STEP 7 Set laravel encryption key, as a heroku config variable

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

#STEP 8 Push app to heroku

git push heroku master

#STEP 9 Open your heroku app, in the browser

heroku open

Enjoy your heroku app

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