Skip to content

Instantly share code, notes, and snippets.

@nathanbarrett
Created July 18, 2016 17:29
Show Gist options
  • Save nathanbarrett/62deb094dfc92fd249bb8615f8d01692 to your computer and use it in GitHub Desktop.
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
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"
}
@nathanbarrett
Copy link
Author

Add to your ~/.bashrc file, then reload your terminal ( or just type 'source ~/.bashrc' )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment