onsa
1/20/2017 - 9:37 PM

CLI commands

CLI commands

# experiment with laravel

  php artisan tinker --env=local

# change application name

  php artisan app:name [appname]

# publish vendor config to config folder

  php artisan vendor:publish

# create migration

  php artisan make:migration [create|do_something_to]_[some]_table
  # use --create=[tablename] for creating a table
  # use --table=[tablename] for altering a table

# execute migration

  php artisan migrate

# rollback last migration

  php artisan migrate:rollback

# rollback all migrations

  php artisan migrate:reset

# rollback all migrations and run them all again

  php artisan migrate:refresh
  # use --seed for seeding again

# seed database

  php artisan db:seed
  #  use --class=[SeederClassName] to execute only one seeder
# dump autoload file and optimise classes

  composer dump-autoload --optimize

# install dependencies defined in composer.json

  composer install
# run test

  vendor/bin/phpunit