Update README.md

pull/1/head
Matt Huntington 5 years ago committed by GitHub
parent 6b0b75422c
commit 1f3b906929
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,6 +1,6 @@
# Steps to Create and Deploy # Steps to Create and Deploy
## Initialize ## Initialize Composer
- Make sure you have MAMP and Postgres installed and running - Make sure you have MAMP and Postgres installed and running
- Download comopser: https://getcomposer.org/composer-stable.phar - Download comopser: https://getcomposer.org/composer-stable.phar
@ -13,19 +13,14 @@
- `echo 'export PATH="/Applications/MAMP/bin/php/php7.4.2/bin:$PATH"' >> ~/.bash_profile` substituting your latest version of php for `php7.4.2` - `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 - close terminal window and open a new one
- run `composer global require laravel/installer`
- go to where you want your app to be and run `laravel new blog` substituting the name of your app for `blog` ## Forking/Cloning This Repo
- `cd` into your app's dir
- run `php artisan serve`
## After Forking/Cloning After forking and cloning this repo to your local machine:
- `cd` to repo dir - `cd` to repo dir
- run `composer install` - run `composer install`
- run `cp .env.example .env` - run `cp .env.example .env`
- go to http://localhost:8000/index.html
- if browser asks you to generate key, click the button
## Connect to db ## Connect to db
@ -38,7 +33,9 @@ CREATE TABLE people (id SERIAL, name VARCHAR(16), age INT);
INSERT INTO people (name, age) VALUES ('matt', 40); INSERT INTO people (name, age) VALUES ('matt', 40);
``` ```
In `.env` file, adjust the following: 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_CONNECTION=mysql
@ -60,13 +57,11 @@ DB_USERNAME=matthuntington
DB_PASSWORD= DB_PASSWORD=
``` ```
## Create routes Instead of `matthuntington` insert your computer's username (what you found when running `whoami`)
In `routes/api.php` add: ## Start App
```php - run `php artisan serve`
Route::get('people', function () { - go to http://localhost:8000/
$users = DB::select('SELECT * FROM people'); - if browser asks you to generate key, click the button
return $users; - go to http://localhost:8000/index.html
});
```

Loading…
Cancel
Save