This is a shoutout to Laravel’s Query Builder method distinct(). I feel sad and embarrassed that I didn’t know about it sooner. There are a lot of instances where I need to get a column’s unique values. And instead of using groupBy() and wasting a lot of resources. You can use distinct(), which will search … Read more
To validate an array of objects in Laravel, you can use the * identifier for each item in an array, and use the “.” syntax to point to the property. So the above would read, “Each item in the row array’s title is required,” etc.