1
0
Fork 0
mirror of https://github.com/archtechx/laravel-tips.git synced 2025-12-12 13:24:03 +00:00

Weekly thread #47

This commit is contained in:
lukinovec 2021-11-26 16:21:56 +01:00
parent 95735fb3c3
commit 5267f948b5
10 changed files with 106 additions and 1 deletions

View file

@ -0,0 +1,13 @@
---
title: 'Use aggregate methods to count related models'
tweet_id: '1464247626405060616'
thread_slug: weekly-thread-2021-47
author_username: alexjgarrett
images:
- 'https://pbs.twimg.com/media/FEy-iNNX0AYjL56.jpg'
created_at: 2021-11-26T15:00:13+00:00
slug: use-aggregate-methods-to-count-related-models
---
When you're counting related models in @laravelphp, opt for aggregates!
👎 Using the count() method on a collection of related models is a tad slower.