└── setup /setup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Let's get started." 4 | 5 | echo -n "What is the name of the database for this app? " 6 | read -e DATABASE 7 | 8 | echo Creating MySQL database 9 | mysql -uroot -p -e "CREATE DATABASE $DATABASE" 10 | 11 | echo Updating database configuration file 12 | gsed -i "s/'database' => 'database'/'database' => '$DATABASE'/" app/config/database.php 13 | gsed -i "s/'password' => ''/'password' => '1234'/" app/config/database.php 14 | 15 | echo -n "Do you need a users table? [yes|no] " 16 | read -e ANSWER 17 | 18 | if [ $ANSWER = 'yes' ] 19 | then 20 | echo Creating users table migration 21 | php artisan generate:migration create_users_table --fields="username:string:unique, email:string:unique, password:string" 22 | 23 | echo Migrating the database 24 | php artisan migrate 25 | fi 26 | --------------------------------------------------------------------------------