Laravel Community Tools by Tighten

Category "Performance" tricks

29 tricks
While returning of date field in JSON, I found some unexpected output which i have posted on stackoverflow. You can see here for more information: http://stackoverflow.com/q/31184170/1318946
pratikbuta... 10 years ago 8733
Now you can deploy Larave 5 easily on Cloudways application hosting management platform. http://www.cloudways.com/en/laravel-hosting.php
yaniksilve... 11 years ago 8194
5.0
Filter for minify html output. Put this code into \app\filters.php
gulch 11 years ago 26506
You can find it here as well: https://github.com/mousavian/laravel-4-custom-db-log or you can just simply do: 1. create logger.php in your "app" folder 2. edit "app\start\global.php" file (or local.php), and add this: 3. all logs will be at "app\storage\logs\query.log"
mousavian 11 years ago 23157
Laravel has many choices for performing a query, sometimes it could be confusing, I hope this list help you to clear any doubts. If you know other way please show it in comments for add it.
luismec90 11 years ago 13967
This filter will prevent the route from having sessions enabled. Very useful for API calls and when you don't want sessions starting. Blog Post: http://dor.ky/laravel-prevent-sessions-for-routes-via-a-filter/
ssx 11 years ago 11350
I recently figured out that you can specify the columns that you want to select from an eager loaded relationship in Eloquent. I thought others might find this useful as I couldn't find much about this online!
stidges 11 years ago 42063
I've used this technique to check if I have called any `->with()` or other relations loaded on a model. I had a need for this since I have a lot of methods that require relation data in order to generate an appended property on the model. For example, if I want to pull all of the recent Posts of an Author and I want to store it on the model as `posts_this_month`, I would need to have Posts relation loaded. I want to force myself to eager load that data before I try to access it, otherwise I could run into an n+1 problem.
chadwithuh... 11 years ago 31176
Combining Model Observers and Cache Tags for very simple but elegant automatic cache flushing on Eloquent Model updates. Can handle both a Model and its Relations easily!
nik-418 12 years ago 30299