Archive for the ‘PHP’ Category

Secrets of the Eloquent

Friday, April 5th, 2019

I was really surprised with some of the cool functionality that’s been unearthed with this recent Laravel Daily post. Some of these I’ve seen quite often and have been ones I’ve done myself!

One of my pet peeves for a long time has been what to do if the relationship is empty, turns out there’s an withDefault() method that can be added to the end of a relationship.