Laravel Community Tools by Tighten

Popular tricks

458 tricks
Use laravel pagination with this small bit of jquery to ajax load paginated results. Create a page with the data you wish to paginate. http://www.example.com/paginated/data
riddles888... 12 years ago 45266
1. create two route files routes.web.php and routes.api.php. 2. edit the RouteServiceProvider.php file to look like the code below: (Note: you can add as many routes as you want, just follow the same logic.)
Mahmoudz 10 years ago 43176
5.0
I recently figured out that you can specify the columns that you want to select from an eager loaded relationship in Eloquent. I thought others might find this useful as I couldn't find much about this online!
stidges 12 years ago 42580
Do not trust the client. Safe way to get CSRF token for use in Angular JS. Keeps it as a constant.
xtrasmal 12 years ago 42542
Sometimes you might want to delete/update a whole lot of items that are related to a model when a record under that model is deleted from the database. This could be useful for various scenarios when there is a lot of processing that needs to be done upon model deletion. Laravel provides model events that you can use in that case.
msurguy 12 years ago 41669
Laravel World is a package providing a list of the countries, states, cities, currencies, and timezones. World integrates data with Eloquent models via the database and provides facades, helpers, and API routes. https://github.com/nnjeim/world
nnjeim 4 years ago 41715
Workflows are more powerful than Laravel's job chaining or batching because they provide a way to implement complex, multi-step processes that can be resumed from a previous state if they fail or crash. https://github.com/laravel-workflow/laravel-workflow
rmcdaniel 3 years ago 39516
CSRF is enabled by default on all Routes in Laravel 5, you can disable it for specific routes by modifying app/Http/Middleware/VerifyCsrfToken.php
aglipanci 11 years ago 38812
Did you know that Laravel comes with a great amount of helpers to generate HTML in your Blade templates, like UL and OL lists, obfuscating email links, links to javascript and style assets? Check out the code below to see the HTML helpers in action.
msurguy 12 years ago 37974