Setup Guide - marist-sga/documentation GitHub Wiki
For sga_site
, use that repository's documentation
1. Install XAMPP or MAMP or something like it
NOTE: Make sure the local Apache server and MySql db are running properly before you start.
You can also install Valet and you don't have to tip!
Valet is a service provided by Laravel that automatically starts a local server on your machine every time you boot up. Valet adds Laravel project folders as localhost domains. For example, for this project, typing sga-website.dev
into Chrome will automatically map to the code on your machine. It even automatically reflects the current git branch you're on.
2. Install Composer
Then run this command: mv composer.phar /usr/local/bin/composer
.
Composer is a PHP package manager. Other people write useful code, such as Laravel. Composer is a command-line application that allows people to "package" useful code they've written and make it available for others to download and use in their projects. Laravel uses lots of packages people have written under the hood. Composer manages all the different versions of all those packages for us, so we don't have to manually download everything.
Get the code
If you're unfamiliar with git, please watch this video to git
up to speed.
4. Install Composer Dependencies
You're going to need to add the vendor
folder. This folder contains all the packages that composer manages for us. You can download them using
composer update
5. Import the Database
You can get it in /database/sga_hub.sql
. If you're using phpmyadmin click on import at the top and select that
- Copy the
.env.example
file contents. - Create a new file called
.env
and paste the contents in there. - The
.env
file is what laravel uses to connect to the local host database. - Make sure
DB_DATABASE=sga_hub
. This is the database Laravel is connecting to and using. - Make sure
DB_USERNAME=root
.root
is the default user for most databases. - Make sure
DB_PASSWORD=
, as in no password. Don't worry, this is all local. As long as it's on your private machine that no one else uses, it's okay.
Note: This newly created .env
file is not tracked by git. This is by design. Each developer has his/her own development env
ironment. Laravel factors out all those differences into this one .env
file, which is all each developer has to maintain. The .env
for production is going to have different property values than the one on your local machine.
6. Done
If you're using Valet, go to sga-website.dev
on Chrome. Voila, the website should appear.
If you're not using Valet, run php artisan serve
in the command line, then enter 127.0.0.1:8000
into Chrome. Voila, the website should appear.
Note: You may need to also run: php artisan key:generate
, which generates an APP_KEY
in the .env
file from the previous step.