Skip to content

Instantly share code, notes, and snippets.

@wzulfikar
Last active December 5, 2015 14:22
Show Gist options
  • Save wzulfikar/0916b6d2d2ff95046d13 to your computer and use it in GitHub Desktop.
Save wzulfikar/0916b6d2d2ff95046d13 to your computer and use it in GitHub Desktop.
things i used commonly in laravel
# generate migration file and use `tasks` as table name
php artisan make:migration create_tasks_table --create=tasks
# `migrate` what we defined in migration file to database
php artisan migrate
# Display all SQL executed in Eloquent
Event::listen('illuminate.query', function($query){
var_dump($query);
});
# enable query log
DB::connection()->enableQueryLog();
DB::getQueryLog();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment