Created
July 18, 2016 17:29
-
-
Save nathanbarrett/62deb094dfc92fd249bb8615f8d01692 to your computer and use it in GitHub Desktop.
bash function for setting up a laravel project with stuff I almost always use
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
function newlaravel | |
{ | |
# Modify to suit your own system | |
YAML=/home/users/Nathan/Homestead.yaml | |
PROJECTSDIR="/media/nathan/Secondary Storage/Github" | |
HOMESTEADDIR="/media/nathan/Secondary Storage/Github" | |
HOSTFILE=/etc/hosts | |
PROJECTNAME=$1 | |
# | |
cd $PROJECTSDIR | |
laravel new $PROJECTNAME | |
cd $PROJECTNAME | |
composer require barryvdh/laravel-ide-helper | |
sed -i.bak '/RouteServiceProvider::class,/a\\n \ \ \ \ \ \ \ Barryvdh\\\LaravelIdeHelper\\\IdeHelperServiceProvider::class,' config/app.php | |
php artisan clear-compiled | |
php artisan ide-helper:generate | |
php artisan ide-helper:meta | |
php artisan optimize | |
npm install | |
git init | |
echo "/.idea" >> .gitignore | |
echo "_ide_helper.php" >> .gitignore | |
echo ".phpstorm.meta.php" >> .gitignore | |
git add . | |
git commit -m "Initial Commit" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add to your ~/.bashrc file, then reload your terminal ( or just type 'source ~/.bashrc' )