Last active
December 5, 2015 14:22
-
-
Save wzulfikar/0916b6d2d2ff95046d13 to your computer and use it in GitHub Desktop.
things i used commonly in laravel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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