Skip to content

Instantly share code, notes, and snippets.

@stillfinder
Last active January 10, 2019 16:46
Show Gist options
  • Save stillfinder/03acc36cca8561a25a8a7517d0fcb3f8 to your computer and use it in GitHub Desktop.
Save stillfinder/03acc36cca8561a25a8a7517d0fcb3f8 to your computer and use it in GitHub Desktop.
Install new Laravel project in Valet parked directory. (Setup DB, composer & yarn, create git repo)
#!/bin/bash
laravel new $1
cd $1
cp ../_ide_helper.php .
cp .env.example .env
composer install
yarn install
php artisan key:generate
mysql -uroot -e "CREATE DATABASE $1;"
sed -i -e 's/'"DB_DATABASE=homestead"'/'"DB_DATABASE=$1"'/g' .env
sed -i -e 's/'"DB_USERNAME=homestead"'/'"DB_USERNAME=root"'/g' .env
sed -i -e 's/'"DB_PASSWORD=secret"'/'"DB_PASSWORD="'/g' .env
touch README.md
git init
git add -A
git commit -m "Initial commit - $1"
open "http://$1.test"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment