#!/usr/bin/env bash

echo " "
echo "LARAVEL"
echo " "

apt-get install -y git curl > /dev/null 2>&1

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === trim(file_get_contents('https://composer.github.io/installer.sig'))) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
php -r "unlink('composer-setup.php');"

cd /vagrant
composer install

# sort out Laravel environment

cp /vagrant/dev/vagrant-config/laravel/.env /vagrant/.env

# Set up DB
php artisan doctrine:migration:refresh
php artisan db:seed

# need to install node
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
apt-get install -y nodejs > /dev/null 2>&1
npm install --global gulp-cli yarn
#!/usr/bin/env bash

echo " "
echo "LARAVEL"
echo " "

apt-get install -y git curl > /dev/null 2>&1

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === trim(file_get_contents('https://composer.github.io/installer.sig'))) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
php -r "unlink('composer-setup.php');"

cd /vagrant
composer install

# sort out Laravel environment

cp /vagrant/dev/vagrant-config/laravel/.env /vagrant/.env

# Set up DB
php artisan doctrine:migration:refresh
php artisan db:seed

# need to install node
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
apt-get install -y nodejs > /dev/null 2>&1
npm install --global gulp-cli yarn

# Setup task scheduler cron
line="* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1"
(crontab -u vagrant -l 2>/dev/null; echo "$line" ) | crontab -u vagrant -
Add cron job to enable the Task Scheduler
Vagrant: Add cron job to enable the Task Scheduler

https://laravel.com/docs/5.3/scheduling
