Last active
          December 28, 2015 05:49 
        
      - 
      
- 
        Save milosh012/7452864 to your computer and use it in GitHub Desktop. 
    Laravel people! Want to find out what SQL queries are run when you are going on some route... Simplest way is to specify event listener in the routes file. Here is example:
  
        
  
    
      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 | |
| // routes.php | |
| Event::listen('illuminate.query', function($sql) { | |
| var_dump($sql); | |
| }); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment