Created
October 4, 2013 11:40
-
-
Save vjandrea/6824658 to your computer and use it in GitHub Desktop.
Laravel 4 query logger. Put this in template's footer. Credits to: http://stackoverflow.com/a/19085511
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
<script type="text/javascript"> | |
var queries = {{ json_encode(DB::getQueryLog()) }}; | |
console.log('/****************************** Database Queries ******************************/'); | |
console.log(' '); | |
$.each(queries, function(id, query) { | |
console.log(' ' + query.time + ' | ' + query.query + ' | ' + query.bindings[0]); | |
}); | |
console.log(' '); | |
console.log('/****************************** End Queries ***********************************/'); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment