Laravel devs, simplify access to latest/oldest related models with this gem! 💎
Use latestOfMany() and oldestOfMany() with hasOne relationships for easy retrieval. Perfect for getting most recent orders or first comments.
Pro tip: Use ofMany() for custom sorting criteria.
www.harrisrafto.eu/mastering-eloquent-simplify-access-to-latest-and-oldest-related-models #Laravel
Back