Laravel Community Tools by Tighten

Tag "database" tricks

87 tricks
If you have an API, which you also use on your site..then you might want to get the data from the API by making an internal request.
xtrasmal 12 years ago 19033
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
xtrasmal 12 years ago 12643
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!
gerob 12 years ago 14202
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.
msurguy 12 years ago 23785
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.
msurguy 12 years ago 125650
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!
stidges 12 years ago 17741