Laravel Community Tools by Tighten

Popular tricks

458 tricks
If we have a blog, sometimes we want to display all latest posts by category. Take an example with this website where I put those posts in a carousel on the homepage: http://dadack.com
mercuryser... 11 years ago 17576
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 17543
cli
It truncates all tables and then it runs all seeders available.
kostaspt 12 years ago 17278
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 17125
//laravel 5 make migration
doguhan 11 years ago 16846
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 16645
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 16609
4.2
In many case you want to display values in blade you can do some check sum like this:
star18bit 11 years ago 16426
This piece of middleware can be applied at a global level, or on a per-route basis. The idea is that instead of polluting your databases with HTML and other potentially damaging data as a result of user input, this middleware will immediately strip all tags from any input, before it gets to validation or saved to a database. The result? A more dependable solution that doesn't require developer memory to implement safe output rules + cleaner data in your database.
kirkbushel... 10 years ago 16395
5.0