This is a project in a trainee program of Mono-Sparta. It's an APP about diving. The project is basded on Laravel Framework 5.8.28
-
Install VirtualBox
-
Install Vagrant
-
Install homestead
All of requirements are in this virtual machine.$ vagrant box add laravel/homestead
-
Install Composer
It's a package for PHP. -
Setup laravel for composer
$ composer require "laravel/homestead"
Make sure to place composer's system-wide vendor bin directory in your PATH so the laravel executable can be located by your system. > This directory exists in different locations based on your operating system; however, some common locations include:
%USERPROFILE%\AppData\Roaming\Composer\vendor\bin
-
Start a new laravel project
$ laravel new projectName
If you still don't know how to install,please take laravel Installation as reference.
-
Install PHP
$ brew install php
-
Install Composer
-
Install Laravel
-
Install Laravel with Composer
$ composer global require “laravel/installer”
Make sure to place composer's system-wide vendor bin directory in your PATH so the laravel executable can be located by your system. This directory exists in different locations based on your operating system; however, some common locations include:
$HOME/.composer/vendor/bin
-
Start a new laravel project
$ laravel new projectName
-
Install Valet
Please take laravel Valet as reference.
NAME | PATH | DESCRIPTION |
---|---|---|
Models of Database Table | /app | Article,Comment,Log,Shop,Spot,and User model |
Controllers | /app/Http/Controllers | Article and Comment controller. Main is in TaskController.php |
Routes | /routes/api.php | Search,Article,and Comment routes |
Database | /database | migrations,seeds,factories |
Because .gitignore will ignore some files,you must do this to restore the laravel project.
Open your terminal,direct PATH where you want to clone at,then follow commends below.
-
git clone
$ git clone https://github.com/MonospaceTW/monosparta-diving-server.git
-
Reinstall composer
It will reconstruction content in the index of vendor.$ cd monosparta-diving-server
$ composer install
-
Restore the index of node_modules
$ npm install
-
Restore .env
$ cp .env.example .env
$ php artisan key:generate
Open .env,then check databese,username,and password are correct.
For example,DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=yourDatabaseName DB_USERNAME=yourUsername DB_PASSWORD=yourPassword
-
Restore Homestead.yaml
$ php vendor/bin/homestead make
-
Start Homestead
$ vagrant up
-
Sign in Homestead,and restore database
$ vagrant ssh
$ cd public_html/yourProjectName
$ php artisan migrate
You can check API list at API Document.