Laravel Community Tools by Tighten

Category "Eloquent" tricks

140 tricks
This example provides a quick and simple method to generate a hash for a model without saving a UUID/GUID to the database.
Donny5300 9 years ago 8563
When I was testing some code I wanted to check if some variable in a JSON column was updated. I was thinking about a LIKE query but when I digged into Laravel's code I saw the following possibility. After all it was pretty obvious because you can do this with normal queries as well, but I still wanted to share this solution.
MrAtiebati... 9 years ago 7841
Automatically deleting related rows in Laravel (Eloquent ORM)
dickyeka 9 years ago 30921
I'm using a pivot table on the project I'm working with to filter category
dickyeka 9 years ago 9669
how can access all the posts belongs to a specific tag someone please explain.
Shashank 9 years ago 6876
Its Diffucult to convert whole object to an array . Normally we are Doing it By Iterate through foreach. By using Below Code we will reduce amount of line of code
kmlnyk 10 years ago 11469
X-editable allows you to create editable elements on your page. It can be used with any engine (bootstrap, jquery-ui, jquery only) and includes both popup and inline modes. Let's have a quick look at implementing this in Laravel apps.
baqirfaroo... 10 years ago 13528
It's a bit tricky to figure out exactly where to put a breakpoint to quickly check your final sql statement before execution. This is for 4.2 but may be similar in
sgelbart 10 years ago 12398
If you need to sprinkle in some caching without building a bunch of Repositories. I've found this base Model and Service Provider very helpful. For updates: https://gist.github.com/danrichards/de22efa41b533d81fa1ec15f42cf64f5
danrichard... 10 years ago 9924