Skip to content

Instantly share code, notes, and snippets.

@stillfinder
Last active May 21, 2019 12:37
Show Gist options
  • Save stillfinder/b9c384d2d175dea286cbc2e42c9777b3 to your computer and use it in GitHub Desktop.
Save stillfinder/b9c384d2d175dea286cbc2e42c9777b3 to your computer and use it in GitHub Desktop.
Create Laravel application
#!/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