10
π₯ The latestOfMany() method lets you use a 'hasMany' relation as a 'hasOne' relation, returning the latest record

π₯ In an Eloquent model can define a relation that will get the newest (or oldest) item of another relation. Very nice!
π Docs: https://laravel.com/docs/8.x/eloquent-relationships#has-one-of-many
#laravel #php