Skip to content

Instantly share code, notes, and snippets.

@vnoitkumar
Last active July 22, 2020 13:07
Show Gist options
  • Save vnoitkumar/e6ff30bb15cf980154e9a4c9bcecef24 to your computer and use it in GitHub Desktop.
Save vnoitkumar/e6ff30bb15cf980154e9a4c9bcecef24 to your computer and use it in GitHub Desktop.
Laravel
# NOTE: Create .env file and configure with proper credentials appropriate for your environment
ENV=.env
NPM=package.json
COMPOSER=composer.json
if [ ! -f "$ENV" ]; then
cp .env.example .env
fi
if test -f "$COMPOSER"; then
composer install
fi
mkdir -p storage # create logs directory if not exist
cd storage
mkdir -p logs # create logs directory if not exist
mkdir -p framework # create framework directory if not exist
cd framework
mkdir -p cache # create cache directory if not exist
mkdir -p sessions # create sessions directory if not exist
mkdir -p views # create views directory if not exist
cd ../..
# clear all the cache
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear
rm -f storage/framework/sessions/* # clear sessions
chmod -R 777 bootstrap storage public
if test -f "$NPM"; then
npm i
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment