Laravel Community Tools by Tighten

Popular tricks

458 tricks
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 13298
If I Let You Go, I Will Never Know - Westlife
saiming96 6 years ago 13294
Dynamically testing and Pagination feature in a Restful API
Mahmoudz 10 years ago 13293
This snippet will explain how to use environment variables to configure your environment. Blog post: http://dor.ky/laravel-homestead-add-enviroment-variables-to-nginx/
ssx 12 years ago 13240
4.1
Ever wanted to route pretty SEO urls to a controller with a specific ID without having to query the DB every time to match the URL to the page? On a number of projects previously, I've created cached versions of route files so that we can save all the URLs for a site and cut down on DB queries to work out what item we're viewing. Create another routes file that you write to whenever an entry is saved. You may end up with a lot of entries in the file, as each route will be for an individual item. Pass the ID to your controller action via the route like so:
Brunty 12 years ago 13162
4.1
Let's say, that your user provide inputs which has arrays like multiple accounts and different crediting and debiting amount, and you need to validate if they are balancing. You will need to extract the array and do some sort of manipulations before proceeding to validation...You can just overload the all() method in your form request class
kamaroly 11 years ago 13156
5.0
This trick is handy for wrapping all of your form elements with the same HTML/classes, which is especially useful for handling error states when using frameworks like Bootstrap or Foundation.
crhayes 12 years ago 12837
This employs Eloquent's polymorphic relationships (https://laravel.com/docs/5.1/eloquent-relationships#polymorphic-relations) to provide a simple flat comment thread system.
Riari 10 years ago 12991
Helper function to mass-map routes to methods. I use this setup in development to quickly map all "test/*" routes to a Test controller, to test out arbitrary PHP code. Updated version also supports DI in controller methods. Updated to correctly fill optional arguments.
davestewar... 11 years ago 12990
5.0