Skip to content

Instantly share code, notes, and snippets.

@riipandi
Last active April 21, 2019 10:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riipandi/0b4acafe9dee5d06d205ce207b99f242 to your computer and use it in GitHub Desktop.
Save riipandi/0b4acafe9dee5d06d205ce207b99f242 to your computer and use it in GitHub Desktop.
Laravel Scaffolding
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
ASSET_URL=${APP_URL}
TELESCOPE_ENABLED=${APP_DEBUG}
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
LOG_CHANNEL=stack
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
@servers(['local' => '127.0.0.1'])
@story('local-install', ['on' => 'local'])
install_packages_dev
install_application_local
@endstory
@story('prod-install', ['on' => 'local'])
install_packages_prod
install_application_prod
@endstory
@task('install_packages_dev')
composer install -o --prefer-dist --no-suggest --no-interaction
npm install --silent
npm run development
@endtask
@task('install_packages_prod')
composer install -o --prefer-dist --no-suggest --no-interaction --no-dev
npm install --no-optional --production --silent
npm run production --silent
@endtask
@task('install_application_local')
composer run post-root-package-install
composer run post-create-project-cmd
mysql -uroot -e "CREATE DATABASE IF NOT EXISTS testing"
sed -i "s/DB_DATABASE=homestead/DB_DATABASE={testing}/" .env
sed -i "s/DB_USERNAME=homestead/DB_USERNAME=root/" .env
sed -i "s/DB_PASSWORD=secret/DB_DATABASE=/" .env
php artisan migrate:fresh --seed
@endtask
@task('install_application_prod')
php artisan down
php artisan migrate:fresh --seed
php artisan vendor:cleanup
php artisan storage:link
php artisan auth:clear-resets
php artisan optimize:clear
php artisan config:cache
php artisan view:clear
php artisan view:cache
php artisan up
@endtask
laravel new myapp
php artisan app:name mynamespace
composer require \
predis/predis \
guzzlehttp/guzzle \
laravel/passport \
laravel/telescope \
laravel/horizon \
garygreen/pretty-routes
php artisan make:auth
php artisan session:table
php artisan cache:table
php artisan queue:failed-table
php artisan queue:table
php artisan notifications:table
composer require predis/predis guzzlehttp/guzzle doctrine/dbal theiconic/name-parser
composer require wnx/laravel-stats --dev
npm i && npm run development
php artisan telescope:install
php artisan horizon:install
php artisan vendor:publish --provider="PrettyRoutes\ServiceProvider"
php artisan telescope:publish
php artisan migrate:fresh --seed
php artisan passport:install
php artisan tinker
$user = new App\User();
$user->name = 'Admin Sistem';
$user->username = 'admin';
$user->password = 'secret';
$user->email = 'admin@mail.com';
$user->email_verified_at = now();
$user->save();
# optional packages
composer require laravel/socialite
# app versioning
composer require pragmarx/version
php artisan vendor:publish --provider="PragmaRX\Version\Package\ServiceProvider"
echo -e '#!/bin/sh\nphp artisan version:refresh' > .git/hooks/post-commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment