Laravel Community Tools by Tighten

Popular tricks

458 tricks
If you have DB column which you want to be set only once and never updated again, you can set that restriction on Eloquent Model, with a mutator
fatihtopra... 5 years ago 17738
Laravel 8 has a nice feature secret route for maintenance bypass. You can get this feature in Laravel 6 or laravel 6 with a simple package called haruncpi/laravel-maintenance.
haruncpi 5 years ago 17643
cli
It truncates all tables and then it runs all seeders available.
kostaspt 12 years ago 17347
For one of my projects I needed to get an ID of the previous and next record in the DB. This could go well with portfolios, orders, blog posts, all kinds of things where you need to display next/previous entry links. Let’s say we are logged in as an admin and we are on this user’s page and we want to see next/previous user’s id. The following Eloquent code makes it easy to do that. Enjoy!
msurguy 12 years ago 17262
//laravel 5 make migration
doguhan 11 years ago 16898
I made a filter for Laravel 5.0 , you can redirect non-www URLs to www URL and you don't need to write any difficult htaccess codes . Just put the filter in routes.php and use it for any Routes you want them to be with WWW . This snipped code is made by www.larabook.ir
hpakdaman 10 years ago 16760
When validating data belonging to multiple models you might be missing errors if you run your validators one by one. This simple trick combines validators and their errors.
The Saint... 11 years ago 16680
4.2
In many case you want to display values in blade you can do some check sum like this:
star18bit 11 years ago 16567
It can sometimes be convenient to automatically validate your model when it gets created or updated. This is very easily achieved with Laravel through the use of Model events.
stidges 12 years ago 16504