Deploy Laravel on Heroku

Eric Johnson
Eric JohnsonSystems Architecture Manager at AMCO International Education Services, Inc.
Deploy Laravel on Heroku
About Me 
Eric Van Johnson 
PHP Developer, Architect and an Organizer of SDPHP 
● Twitter: @shocm 
● IRC: @shocm
Laravel 101 
We start with a standard Laravel deployment 
And then a cd into our project directory
Unlock you lock 
We want to remove ‘composer.lock’ from 
.gitignore
Heroku Procfile 
You can configure Heroku server by leveraging 
a ‘Procfile’. We will use this to update our doc 
root to point to our /public directory
Git’er Done 
Next we initiate our Git repo and commit 
some changes.
Use the --force 
Your Laravel application will complain if it 
doesn’t have a log file and it’s unable to 
create one once deployed to Heroku. So we 
will create it now and force add it to the repo
Commit to your choices in life 
Now we can do a git commit of our project.
Heroku Time 
You’ll need to have a Heroku account and have 
the Heroku Toolbelt installed and configured. 
Great place to get started: 
https://devcenter.heroku.com/articles/getting-started-with-php#introduction 
We’ll flash forward past this
Spinning up Heroku 
We create our Heroku instance and deploy our 
repo to it.
Check out your awesome app 
At this time we 
have our basic 
Laravel 
Application 
deployed and 
can view it.
Add layers to the Application 
Let’s update our routes, add a controller and add 
a view like a normal application. 
app/routes.php app/controllers/HelloController.php 
app/views/hello/index.blade.php
Check out your awesome app 
Commit, push to 
Heroku and go 
to the new 
route.
Adding PostgreSQL to your app 
Why PostgreSQL and not MySQL? 
● Heroku doesn’t have ‘native’ MySQL support 
● In Heroku world, PostgreSQL is a first class citizen. 
● There is a solution that allows you to add a MySQL to your 
Heroku app called ‘ClearDB’ addon if you really want it. 
● Since we are using Laravel and Eloquent, we don’t actual 
care what our datastore is.
Adding PostgreSQL (Part 2) 
Adding PostgreSQL is as simple as running a command.
A peek at the config 
Let’s see what was assigned to us
Modify start.php 
We are going to edit bootstrap/start.php to better detect 
environments
Create Heroku Configurations 
Next we create configuration files specifically for Heroku at the 
following path
Configure Database 
app/config/heroku/database.php 
Also be sure to update 
app/config/database.php and define 
PostgeSQL 
● 'default' => 'pgsql', 
Commit and push
Create APP_ENV Variable 
Remember we are detecting which environment 
we are in, in start.php using the variable 
‘APP_ENV’. We will need to create and add that 
variable to our Heroku environment.
Create a migration 
Now we create a migration using the normal 
Laravel commands. 
Commit and Push
Run migration 
After we push our new migration we need to run 
the migration in the Heroku environment.
Check migration was successful
Enjoy Life 
START CODING!
1 of 24

Recommended

Infinum Android Talks #04 - How to publish an Android archive (.aar) to Maven... by
Infinum Android Talks #04 - How to publish an Android archive (.aar) to Maven...Infinum Android Talks #04 - How to publish an Android archive (.aar) to Maven...
Infinum Android Talks #04 - How to publish an Android archive (.aar) to Maven...Denis_infinum
396 views9 slides
Get started with AAR by
Get started with AARGet started with AAR
Get started with AARRené Mertins
4.8K views35 slides
OWASP Nagpur Meet #3 Android RE by
OWASP Nagpur Meet #3 Android REOWASP Nagpur Meet #3 Android RE
OWASP Nagpur Meet #3 Android REOWASP Nagpur
102 views16 slides
Openstack contribution process by
Openstack contribution processOpenstack contribution process
Openstack contribution processSyed Armani
1.8K views8 slides
Introduction to Git for Artists by
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for ArtistsDavid Newbury
4.4K views61 slides
Modern web app with REACT by
Modern web app with REACTModern web app with REACT
Modern web app with REACTAndryRajohnson
101 views36 slides

More Related Content

What's hot

Agile android by
Agile androidAgile android
Agile androidGodfrey Nolan
1.4K views23 slides
The Dog Ate My Deployment - PHP Uncoference September 2013 by
The Dog Ate My Deployment - PHP Uncoference September 2013The Dog Ate My Deployment - PHP Uncoference September 2013
The Dog Ate My Deployment - PHP Uncoference September 2013D
2.3K views41 slides
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ... by
Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...D
2.7K views72 slides
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013 by
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013D
1.2K views43 slides
Creating global functions by
Creating global functionsCreating global functions
Creating global functionsRahul Kumar
1.7K views7 slides
Up & running with ECMAScript6 by
Up & running with ECMAScript6Up & running with ECMAScript6
Up & running with ECMAScript6Nir Kaufman
1.7K views28 slides

What's hot(20)

The Dog Ate My Deployment - PHP Uncoference September 2013 by D
The Dog Ate My Deployment - PHP Uncoference September 2013The Dog Ate My Deployment - PHP Uncoference September 2013
The Dog Ate My Deployment - PHP Uncoference September 2013
D 2.3K views
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ... by D
Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...Dennis Benkert -  The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
Dennis Benkert - The Dog Ate My Deployment - Symfony Usergroup Berlin March ...
D 2.7K views
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013 by D
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
The Dog Ate My Deployment - Symfony Usergroup Cologne July 2013
D 1.2K views
Creating global functions by Rahul Kumar
Creating global functionsCreating global functions
Creating global functions
Rahul Kumar1.7K views
Up & running with ECMAScript6 by Nir Kaufman
Up & running with ECMAScript6Up & running with ECMAScript6
Up & running with ECMAScript6
Nir Kaufman1.7K views
Composer and deployer for enterprise by Elena Pustovoit
Composer and deployer for enterpriseComposer and deployer for enterprise
Composer and deployer for enterprise
Elena Pustovoit152 views
Dev with github enterprise by Hiroshi Wada
Dev with github enterpriseDev with github enterprise
Dev with github enterprise
Hiroshi Wada2K views
Recovering From Git Mistakes - Nina Zakharenko by Nina Zakharenko
Recovering From Git Mistakes - Nina ZakharenkoRecovering From Git Mistakes - Nina Zakharenko
Recovering From Git Mistakes - Nina Zakharenko
Nina Zakharenko1.1K views
ComponenKit and React Native by Stanfy
ComponenKit and React NativeComponenKit and React Native
ComponenKit and React Native
Stanfy1.2K views
Introduction to Git by Rick Umali
Introduction to GitIntroduction to Git
Introduction to Git
Rick Umali933 views
Shift Remote: Mobile - Devops-ify your life with Github Actions - Nicola Cort... by Shift Conference
Shift Remote: Mobile - Devops-ify your life with Github Actions - Nicola Cort...Shift Remote: Mobile - Devops-ify your life with Github Actions - Nicola Cort...
Shift Remote: Mobile - Devops-ify your life with Github Actions - Nicola Cort...
Shift Conference61 views
My Top 5 Favorite Gems by Jimmy Ngu
My Top 5 Favorite GemsMy Top 5 Favorite Gems
My Top 5 Favorite Gems
Jimmy Ngu242 views
Nikolai Boiko "NodeJS Refactoring: How to kill a Dragon and stay alive" by NodeUkraine
Nikolai Boiko "NodeJS Refactoring: How to kill a Dragon and stay alive"Nikolai Boiko "NodeJS Refactoring: How to kill a Dragon and stay alive"
Nikolai Boiko "NodeJS Refactoring: How to kill a Dragon and stay alive"
NodeUkraine46 views
Adventures with Angular 2 by Dragos Ionita
Adventures with Angular 2Adventures with Angular 2
Adventures with Angular 2
Dragos Ionita612 views
React Native - Getting Started by Tracy Lee
React Native - Getting StartedReact Native - Getting Started
React Native - Getting Started
Tracy Lee2.1K views

Viewers also liked

Irrfan Khan: Journey from Theater to Hollywood by
Irrfan Khan: Journey from Theater to HollywoodIrrfan Khan: Journey from Theater to Hollywood
Irrfan Khan: Journey from Theater to HollywoodJigna Choksi
4K views35 slides
Robber Barons by
Robber BaronsRobber Barons
Robber Baronsgrillo3
996 views15 slides
Unit Notes Jess by
Unit Notes JessUnit Notes Jess
Unit Notes Jessjweaver00
939 views101 slides
Unionization lecture by
Unionization lectureUnionization lecture
Unionization lectureskohr
239 views22 slides
Men who built america cornelius vanderbilt by
Men who built america cornelius vanderbiltMen who built america cornelius vanderbilt
Men who built america cornelius vanderbiltmrsstrong-clay
2.3K views2 slides
Robber baronsor captainsofindustryppt by
Robber baronsor captainsofindustrypptRobber baronsor captainsofindustryppt
Robber baronsor captainsofindustrypptHigh School
5.9K views20 slides

Viewers also liked(19)

Irrfan Khan: Journey from Theater to Hollywood by Jigna Choksi
Irrfan Khan: Journey from Theater to HollywoodIrrfan Khan: Journey from Theater to Hollywood
Irrfan Khan: Journey from Theater to Hollywood
Jigna Choksi4K views
Robber Barons by grillo3
Robber BaronsRobber Barons
Robber Barons
grillo3996 views
Unit Notes Jess by jweaver00
Unit Notes JessUnit Notes Jess
Unit Notes Jess
jweaver00939 views
Unionization lecture by skohr
Unionization lectureUnionization lecture
Unionization lecture
skohr239 views
Men who built america cornelius vanderbilt by mrsstrong-clay
Men who built america cornelius vanderbiltMen who built america cornelius vanderbilt
Men who built america cornelius vanderbilt
mrsstrong-clay2.3K views
Robber baronsor captainsofindustryppt by High School
Robber baronsor captainsofindustrypptRobber baronsor captainsofindustryppt
Robber baronsor captainsofindustryppt
High School5.9K views
Cornelius Vanderbilt by nschaff
Cornelius VanderbiltCornelius Vanderbilt
Cornelius Vanderbilt
nschaff1.6K views
Cornelius Vanderbilt (the commodore) by Nicholas Hoang
Cornelius Vanderbilt (the commodore)Cornelius Vanderbilt (the commodore)
Cornelius Vanderbilt (the commodore)
Nicholas Hoang2.5K views
Theodore roosevelt 4 by happyparrot
Theodore roosevelt 4Theodore roosevelt 4
Theodore roosevelt 4
happyparrot839 views
George Eastman by Debbs2013
George EastmanGeorge Eastman
George Eastman
Debbs20131.2K views
Andrew Carnegie by kimstaa
Andrew CarnegieAndrew Carnegie
Andrew Carnegie
kimstaa5.5K views
Cornelius Vanderbilt I by Grazyele123
Cornelius Vanderbilt ICornelius Vanderbilt I
Cornelius Vanderbilt I
Grazyele1233.3K views
Robber barons or captains of industry 2011 by Joseph Fuertsch
Robber barons or captains of industry 2011Robber barons or captains of industry 2011
Robber barons or captains of industry 2011
Joseph Fuertsch5.2K views
Rise of the Robber Barons by mrgeib
Rise of the Robber BaronsRise of the Robber Barons
Rise of the Robber Barons
mrgeib2.2K views
Robber Barons & Captains of Industry by Diana Fordham
Robber Barons & Captains of Industry Robber Barons & Captains of Industry
Robber Barons & Captains of Industry
Diana Fordham5.5K views
Industrial america part 2 immigration urbanization and labor 2016 by Elhem Chniti
Industrial america part 2  immigration urbanization and labor 2016Industrial america part 2  immigration urbanization and labor 2016
Industrial america part 2 immigration urbanization and labor 2016
Elhem Chniti1.6K views
Unit 1 powerpoint #6 (the gilded age political machines) by Jason Lowe
Unit 1 powerpoint #6 (the gilded age   political machines)Unit 1 powerpoint #6 (the gilded age   political machines)
Unit 1 powerpoint #6 (the gilded age political machines)
Jason Lowe27.4K views
The 10 Most Important Banking Metrics by John J. Maxfield
The 10 Most Important Banking MetricsThe 10 Most Important Banking Metrics
The 10 Most Important Banking Metrics
John J. Maxfield110K views

Similar to Deploy Laravel on Heroku

Django Girls Tutorial by
Django Girls TutorialDjango Girls Tutorial
Django Girls TutorialKishimi Ibrahim Ishaq
2K views79 slides
Plugin development demystified 2017 by
Plugin development demystified 2017Plugin development demystified 2017
Plugin development demystified 2017ylefebvre
1.4K views49 slides
Developing WordPress Plugins : For Begineers by
Developing WordPress Plugins :  For BegineersDeveloping WordPress Plugins :  For Begineers
Developing WordPress Plugins : For BegineersM A Hossain Tonu
4.2K views54 slides
Heroku + Jeweler & Gemcutter by
Heroku + Jeweler & GemcutterHeroku + Jeweler & Gemcutter
Heroku + Jeweler & GemcutterAriejan de Vroom
750 views86 slides
Install laravel on openshift by
Install laravel on openshiftInstall laravel on openshift
Install laravel on openshiftSamy Saad
1.3K views8 slides
Drupal Deployment by
Drupal DeploymentDrupal Deployment
Drupal DeploymentJeff Eaton
55.4K views67 slides

Similar to Deploy Laravel on Heroku(20)

Plugin development demystified 2017 by ylefebvre
Plugin development demystified 2017Plugin development demystified 2017
Plugin development demystified 2017
ylefebvre1.4K views
Developing WordPress Plugins : For Begineers by M A Hossain Tonu
Developing WordPress Plugins :  For BegineersDeveloping WordPress Plugins :  For Begineers
Developing WordPress Plugins : For Begineers
M A Hossain Tonu4.2K views
Install laravel on openshift by Samy Saad
Install laravel on openshiftInstall laravel on openshift
Install laravel on openshift
Samy Saad1.3K views
Drupal Deployment by Jeff Eaton
Drupal DeploymentDrupal Deployment
Drupal Deployment
Jeff Eaton55.4K views
AngularJS Project Setup step-by- step guide - RapidValue Solutions by RapidValue
AngularJS Project Setup step-by- step guide - RapidValue SolutionsAngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS Project Setup step-by- step guide - RapidValue Solutions
RapidValue13.1K views
Building a blog with an Onion Architecture by Barry O Sullivan
Building a blog with an Onion ArchitectureBuilding a blog with an Onion Architecture
Building a blog with an Onion Architecture
Barry O Sullivan254 views
Onion Architecture and the Blog by barryosull
Onion Architecture and the BlogOnion Architecture and the Blog
Onion Architecture and the Blog
barryosull2.1K views
Docker for Artisans by RenPardon
Docker for ArtisansDocker for Artisans
Docker for Artisans
RenPardon72 views
Behavior & Specification Driven Development in PHP - #OpenWest by Joshua Warren
Behavior & Specification Driven Development in PHP - #OpenWestBehavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWest
Joshua Warren1.4K views
A winning combination: Plone as CMS and your favorite Python web framework as... by Carlos de la Guardia
A winning combination: Plone as CMS and your favorite Python web framework as...A winning combination: Plone as CMS and your favorite Python web framework as...
A winning combination: Plone as CMS and your favorite Python web framework as...
php-and-zend-framework-getting-started by tutorialsruby
php-and-zend-framework-getting-startedphp-and-zend-framework-getting-started
php-and-zend-framework-getting-started
tutorialsruby380 views
php-and-zend-framework-getting-started by tutorialsruby
php-and-zend-framework-getting-startedphp-and-zend-framework-getting-started
php-and-zend-framework-getting-started
tutorialsruby430 views
php-and-zend-framework-getting-started by tutorialsruby
php-and-zend-framework-getting-startedphp-and-zend-framework-getting-started
php-and-zend-framework-getting-started
tutorialsruby363 views
php-and-zend-framework-getting-started by tutorialsruby
php-and-zend-framework-getting-startedphp-and-zend-framework-getting-started
php-and-zend-framework-getting-started
tutorialsruby314 views
Deploying Web Apps with PaaS and Docker Tools by Eddie Lau
Deploying Web Apps with PaaS and Docker ToolsDeploying Web Apps with PaaS and Docker Tools
Deploying Web Apps with PaaS and Docker Tools
Eddie Lau1.5K views

More from Eric Johnson

Git - the stupid content tracker by
Git - the stupid content trackerGit - the stupid content tracker
Git - the stupid content trackerEric Johnson
544 views13 slides
Composer Lightning Talk by
Composer Lightning TalkComposer Lightning Talk
Composer Lightning TalkEric Johnson
364 views13 slides
Google App Engine for PHP by
Google App Engine for PHP Google App Engine for PHP
Google App Engine for PHP Eric Johnson
1.4K views29 slides
Introduction to PHP (SDPHP) by
Introduction to PHP   (SDPHP)Introduction to PHP   (SDPHP)
Introduction to PHP (SDPHP)Eric Johnson
784 views50 slides
Intro to CakePHP - SDPHP MeetUp Dec 2012 by
Intro to CakePHP - SDPHP MeetUp Dec 2012Intro to CakePHP - SDPHP MeetUp Dec 2012
Intro to CakePHP - SDPHP MeetUp Dec 2012Eric Johnson
276 views5 slides
Introduction to PHP - SDPHP by
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHPEric Johnson
687 views49 slides

More from Eric Johnson(6)

Git - the stupid content tracker by Eric Johnson
Git - the stupid content trackerGit - the stupid content tracker
Git - the stupid content tracker
Eric Johnson544 views
Composer Lightning Talk by Eric Johnson
Composer Lightning TalkComposer Lightning Talk
Composer Lightning Talk
Eric Johnson364 views
Google App Engine for PHP by Eric Johnson
Google App Engine for PHP Google App Engine for PHP
Google App Engine for PHP
Eric Johnson1.4K views
Introduction to PHP (SDPHP) by Eric Johnson
Introduction to PHP   (SDPHP)Introduction to PHP   (SDPHP)
Introduction to PHP (SDPHP)
Eric Johnson784 views
Intro to CakePHP - SDPHP MeetUp Dec 2012 by Eric Johnson
Intro to CakePHP - SDPHP MeetUp Dec 2012Intro to CakePHP - SDPHP MeetUp Dec 2012
Intro to CakePHP - SDPHP MeetUp Dec 2012
Eric Johnson276 views
Introduction to PHP - SDPHP by Eric Johnson
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
Eric Johnson687 views

Recently uploaded

Igniting Next Level Productivity with AI-Infused Data Integration Workflows by
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Safe Software
344 views86 slides
Ransomware is Knocking your Door_Final.pdf by
Ransomware is Knocking your Door_Final.pdfRansomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdfSecurity Bootcamp
76 views46 slides
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ... by
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...ShapeBlue
77 views12 slides
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...ShapeBlue
63 views13 slides
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...ShapeBlue
88 views20 slides
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue by
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlueMigrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlueShapeBlue
96 views20 slides

Recently uploaded(20)

Igniting Next Level Productivity with AI-Infused Data Integration Workflows by Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software344 views
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ... by ShapeBlue
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
Backup and Disaster Recovery with CloudStack and StorPool - Workshop - Venko ...
ShapeBlue77 views
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by ShapeBlue
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
ShapeBlue63 views
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... by ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue88 views
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue by ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlueMigrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
ShapeBlue96 views
Data Integrity for Banking and Financial Services by Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely56 views
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P... by ShapeBlue
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
ShapeBlue82 views
NTGapps NTG LowCode Platform by Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu141 views
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院 by IttrainingIttraining
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
Five Things You SHOULD Know About Postman by Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman40 views
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ... by ShapeBlue
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
How to Re-use Old Hardware with CloudStack. Saving Money and the Environment ...
ShapeBlue65 views
Why and How CloudStack at weSystems - Stephan Bienek - weSystems by ShapeBlue
Why and How CloudStack at weSystems - Stephan Bienek - weSystemsWhy and How CloudStack at weSystems - Stephan Bienek - weSystems
Why and How CloudStack at weSystems - Stephan Bienek - weSystems
ShapeBlue111 views
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... by Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker50 views
Business Analyst Series 2023 - Week 3 Session 5 by DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10369 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... by James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson133 views
PharoJS - Zürich Smalltalk Group Meetup November 2023 by Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi141 views
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha... by ShapeBlue
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
Mitigating Common CloudStack Instance Deployment Failures - Jithin Raju - Sha...
ShapeBlue74 views

Deploy Laravel on Heroku

  • 2. About Me Eric Van Johnson PHP Developer, Architect and an Organizer of SDPHP ● Twitter: @shocm ● IRC: @shocm
  • 3. Laravel 101 We start with a standard Laravel deployment And then a cd into our project directory
  • 4. Unlock you lock We want to remove ‘composer.lock’ from .gitignore
  • 5. Heroku Procfile You can configure Heroku server by leveraging a ‘Procfile’. We will use this to update our doc root to point to our /public directory
  • 6. Git’er Done Next we initiate our Git repo and commit some changes.
  • 7. Use the --force Your Laravel application will complain if it doesn’t have a log file and it’s unable to create one once deployed to Heroku. So we will create it now and force add it to the repo
  • 8. Commit to your choices in life Now we can do a git commit of our project.
  • 9. Heroku Time You’ll need to have a Heroku account and have the Heroku Toolbelt installed and configured. Great place to get started: https://devcenter.heroku.com/articles/getting-started-with-php#introduction We’ll flash forward past this
  • 10. Spinning up Heroku We create our Heroku instance and deploy our repo to it.
  • 11. Check out your awesome app At this time we have our basic Laravel Application deployed and can view it.
  • 12. Add layers to the Application Let’s update our routes, add a controller and add a view like a normal application. app/routes.php app/controllers/HelloController.php app/views/hello/index.blade.php
  • 13. Check out your awesome app Commit, push to Heroku and go to the new route.
  • 14. Adding PostgreSQL to your app Why PostgreSQL and not MySQL? ● Heroku doesn’t have ‘native’ MySQL support ● In Heroku world, PostgreSQL is a first class citizen. ● There is a solution that allows you to add a MySQL to your Heroku app called ‘ClearDB’ addon if you really want it. ● Since we are using Laravel and Eloquent, we don’t actual care what our datastore is.
  • 15. Adding PostgreSQL (Part 2) Adding PostgreSQL is as simple as running a command.
  • 16. A peek at the config Let’s see what was assigned to us
  • 17. Modify start.php We are going to edit bootstrap/start.php to better detect environments
  • 18. Create Heroku Configurations Next we create configuration files specifically for Heroku at the following path
  • 19. Configure Database app/config/heroku/database.php Also be sure to update app/config/database.php and define PostgeSQL ● 'default' => 'pgsql', Commit and push
  • 20. Create APP_ENV Variable Remember we are detecting which environment we are in, in start.php using the variable ‘APP_ENV’. We will need to create and add that variable to our Heroku environment.
  • 21. Create a migration Now we create a migration using the normal Laravel commands. Commit and Push
  • 22. Run migration After we push our new migration we need to run the migration in the Heroku environment.
  • 23. Check migration was successful
  • 24. Enjoy Life START CODING!