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 8 years ago 8242
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 7520
Automatically deleting related rows in Laravel (Eloquent ORM)
dickyeka 9 years ago 30479
I'm using a pivot table on the project I'm working with to filter category
dickyeka 9 years ago 9393
how can access all the posts belongs to a specific tag someone please explain.
Shashank 9 years ago 6539
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 9 years ago 11065
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... 9 years ago 13139
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 9 years ago 12056
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... 9 years ago 9582