Code for altfantasysports.com.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install php72 phpunit node composer
brew tap wilmoore/formulae
brew install php-version
echo '[[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc' >> ~/.bash_profile
echo 'source "$(brew --prefix php-version)/php-version.sh" && php-version 7' >> ~/.bash_profile
NOTE: May need to change .bash_profile
to .zshrc
if using zshell which is
the new default shell on Catalina (untested).
TODO: Document Dependencies for Windows/Linux
composer install
npm install
touch database/database.sqlite
Or create a new empty file called database.sqlite
in
[PATH_TO_APP_ROOT_DIR]/database
.
cp .env.example .env
APP_ROOT="$(pwd)"
sed -i '' -e 's/DB_CONNECTION=mysql/DB_CONNECTION=sqlite/' .env
sed -i '' -e "s;DB_DATABASE=laravel;DB_DATABASE=$APP_ROOT/database/database.sqlite;" .env
Or rename .env.example
to .env
and make these changes:
DB_CONNECTION=sqlite
DB_DATABASE=[PATH_TO_APP_ROOT_DIR]/database/database.sqlite
php artisan migrate:install
php artisan migrate
php artisan key:generate
php artisan jwt:secret
The sample data that can be seeded creates 4 users of the site: [email protected],[email protected],[email protected], and [email protected], all with the password of 'password'
php artisan db:seed
If not using apache or another web server, run the embedded server with:
php artisan serve --port=9090
- start node
npm run watch
touch database/test.sqlite
Or create a new empty file called test.sqlite
in
[PATH_TO_APP_ROOT_DIR]/database
.
cp .env.test.example .env.test
APP_ROOT="$(pwd)"
sed -i '' -e "s;DB_DATABASE=laravel;DB_DATABASE=$APP_ROOT/database/test.sqlite;" .env.test
Or rename .env.test.example
to .env.test
and make these changes:
DB_DATABASE=[PATH_TO_APP_ROOT_DIR]/database/test.sqlite
phpunit
php artisan route:list
php artisan schema:show
-
JWT_REFRESH_TTL (number of minutes refresh token is valid for, once invalid the user will have to re-authenticate/login)
-
JWT_TTL (token stays valid for x number of minutes then app will try to refresh)
-
optional lamp stack: https://bitnami.com/stack/lamp/installer and install the laravel module during install.