Last active
May 17, 2017 16:10
-
-
Save alfredoem/9d00571526df24543d9b4d8345bdd316 to your computer and use it in GitHub Desktop.
Laravel Framework Tricks
This file contains hidden or 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
<?php | |
#Last Query | |
\DB::enableQueryLog(); | |
// code request | |
$query = \DB::getQueryLog(); | |
$lastQuery = end($query); | |
\Log::info(json_encode($lastQuery)); | |
#Last Query Multiple connection | |
\DB::connection('other-name')->enableQueryLog(); | |
// code request | |
$query = \DB::connection('other-name')->getQueryLog(); | |
$lastQuery = end($query); | |
\Log::info(json_encode($lastQuery)); | |
#Views Cache Clear | |
php artisan view:clear |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment