Laravel Community Tools by Tighten

Recent tricks

458 tricks
For example, if you are using a caching server which listens on HTTPS, which retrieves your content from another (local server) which isn't using HTTPS, your links might be generated as http://mysite.com instead of the desired https://mysite.com. With this trick you can circumvent this.
berendiwem... 12 years ago 9045
Further explanation: http://www.codinghobo.com/re-organising-laravel-applications-with-psr-4/
rmasters 12 years ago 19196
This macro has the same signature than HTML::linkRoute() but wraps the hypertext link with <li></li>. If the current URL is the specified route, then <li> becomes "active" (<li class="active>...</li>). I use it to quickly build menus. Work well with Bootstrap.
Matt 12 years ago 8702
Uses "thepixeldeveloper/sitemap": "dev-master" in composer.json to create a better organised sitemap structure via multiple "files" (routes).
nik-418 12 years ago 10830
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 30263
Here's a simple little scope that you can use to get a random collection of Model objects from the database.
davidhemph... 12 years ago 11654
Use this to generate a select box from a Eloquent Collection
xLink 12 years ago 11323
For those who don't know. These ways of code are equivalent.
egig 12 years ago 10190
Sometimes you want to render a partial without sharing all the scope. I often found that the scope inheritance between highly decoupled UI modules makes hard to find errors, because we end up using similar variable names in each module (using @include) Let me show you an example:
fedeisas 12 years ago 10215