Last active
January 10, 2019 16:46
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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