Laravel Community Tools by Tighten

Popular tricks

459 tricks
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 13121
4.1
If I Let You Go, I Will Never Know - Westlife
saiming96 6 years ago 13090
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 13048
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 10 years ago 13018
5.0
Laravel State Management is a powerful, Redux-inspired solution for managing complex application state across services, requests, and caching layers. This package allows you to define shared state, easily persist and rehydrate data, and implement custom methods for state manipulation. With features like attribute casting, default state handling, and global store access, it provides a robust system for managing state across your Laravel app.
mustafakha... 1 year ago 12957
with this trait you can get Enum values of a table /
nimahkh 8 years ago 12867
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 12641
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 12841
5.0
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 12820