Use this trick to log queries using Monolog.
Add this to your routes.php and log straight into your Firebug console. Firebug needs the FirePHP add-on.
- kisses Netbulae
This is specific to using Redis for caching. You can group your keys in sections to allow for easily clearing the cache on just a section of data.
Couple notes:
1. You have to have 'cluster' set to false in app/config/database.php under the 'redis' key.
2. Remember to pass through variables into the closure with 'use'.
3. Have fun!
When doing some sort of filtering in Eloquent, sometimes you need to use operators other than "=" and there is no easy way to know which operators you can use. This trick details the possible operators for you.
Put this in your routes.php file and you will see the SQL that Eloquent is executing when you go to pages that have any sort of access to Eloquent models.
This helps a lot when debugging SQL in Laravel.
Ever find yourself wanting to only find models that have a certain relationship matching certain conditions? Laravel 4.1 makes this really easy, and introduces great eager loading constraints!