You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Matt Huntington ac37db0bcd
Update README.md
5 years ago
app init laravel 5 years ago
bootstrap init laravel 5 years ago
config init laravel 5 years ago
database init laravel 5 years ago
public react 5 years ago
resources init laravel 5 years ago
routes order by id asc 5 years ago
storage init laravel 5 years ago
tests init laravel 5 years ago
.editorconfig init laravel 5 years ago
.env.example init laravel 5 years ago
.gitattributes init laravel 5 years ago
.gitignore init laravel 5 years ago
.styleci.yml init laravel 5 years ago
Procfile Procfile for Heroku 5 years ago
README.md Update README.md 5 years ago
README_LARAVEL.md init laravel 5 years ago
artisan init laravel 5 years ago
composer.json init laravel 5 years ago
composer.lock init laravel 5 years ago
package-lock.json init laravel 5 years ago
package.json init laravel 5 years ago
phpunit.xml init laravel 5 years ago
server.php init laravel 5 years ago
webpack.mix.js init laravel 5 years ago

README.md

Steps to Create and Deploy

Set up local app

Install Composer

  • Make sure you have MAMP and Postgres installed and running

  • Download comopser: https://getcomposer.org/composer-stable.phar

  • In Terminal, run:

    • mv ~/Downloads/composer-stable.phar /usr/local/bin/composer
    • chmod 755 /usr/local/bin/composer
    • echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"' >> ~/.bash_profile
    • ls /Applications/MAMP/bin/php and take note of the most recent version
    • echo 'export PATH="/Applications/MAMP/bin/php/php7.4.2/bin:$PATH"' >> ~/.bash_profile substituting your latest version of php for php7.4.2
  • close terminal window and open a new one

Forking/Cloning This Repo

After forking and cloning this repo to your local machine:

  • cd to repo dir
  • run composer install
  • run cp .env.example .env

Connect to db

Connect to psql and

CREATE DATABASE contacts;
\c contacts
CREATE TABLE people (id SERIAL, name VARCHAR(16), age INT);
INSERT INTO people (name, age) VALUES ('matt', 40);

Run whoami and take note over your computer's username (mine is matthuntington)

In .env file, adjust the following code block:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

so it is:

DB_CONNECTION=pgsql
DB_HOST=localhost
DB_PORT=5432
DB_DATABASE=contacts
DB_USERNAME=matthuntington
DB_PASSWORD=

Instead of matthuntington insert your computer's username (what you found when running whoami)

Start App

set up heroku

in your terminal

  1. run heroku create (take note of the app name for later)
  2. run heroku config:set LOG_CHANNEL=errorlog
  3. run heroku config:set APP_KEY=$(php artisan --no-ansi key:generate --show)

in your browser

  1. go to heroku.com in your browser and sign in
  2. find this newly created heroku app in your list of available apps and click on it
  3. go to resources
  4. search for postgres and choose Heroku Postgres
  5. choose "Hobby Dev - Free"
  6. click provision

in your terminal

  1. in your terminal, if running psql gives you "command not found", run ln -s /Applications/Postgres.app/Contents/Versions/latest/bin/psql /usr/local/bin/psql
  2. run heroku pg:psql
  3. once inside heroku's psql, run
    1. CREATE TABLE people (id SERIAL, name VARCHAR(16), age INT);
    2. INSERT INTO people ( name, age ) VALUES ( 'Matt', 38 );
    3. INSERT INTO people ( name, age ) VALUES ( 'Sally', 54 );
    4. INSERT INTO people ( name, age ) VALUES ( 'Zanthar', 4892 );
  4. exit heroku psql with \q