pranayaryal
3/16/2017 - 5:02 PM

START A NEW LARAVEL PROJECT (EXAMPLE SAR)

START A NEW LARAVEL PROJECT (EXAMPLE SAR)

####Creating SSH Key
create ssh key
type "ssh-keygen" which will generate a ssh-key for you. Just press enter for all default values
type cat ~/.ssh/idrsa_key.pub
whatever the output is, copy and send it to chris.

ask chris to allow you ssh key access into
clone the sar-upgrade respository and checkout the dev branch by typing "git fetch && git checkout dev"

#### Making storage/ and bootstrap/ writeable
type  "sudo chmod 777 -R storage/"
type "sudo chmod 777 -R bootstrap/cache"

Run migrations with "php artisan migrate --path=/database/migrations/vendor"
copy over the .env file and change database username and password accordingly

If you get the error "PDO Exception: could not find driver", 
run sudo apt-get install php-mysql

if there is an error saying "invalid default value for created_at" then go to /etc/mysql/my.cnf. Add this line there
[mysqld]
sql_mode=ONLY_FULL_GROUP_BY,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

See configuring ngnix server for project

Don't forget to type "[mysqld]"

Create a database
copy the .env file from someone
change DB_DATABASE=sar_5
DB_USERNAME=root
DB_PASSWORD=secret

then run sudo /etc/init.d/mysql restart

retype "php artisan migrate --path=/database/migrations/vendor"
Run  php artisan migrate


Usually you might get errors like 'base table doesn't exist'

type "php artisan migrate:status"
Go to the first migration that wasn't completed and look for that table shown in the error.
Add a check for that table in your code
Something like  if Schema::hasTable();