We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c020a6 commit 4e7c4adCopy full SHA for 4e7c4ad
README.md
@@ -405,6 +405,15 @@ Aggregations can be combined with **where**:
405
$sold = Orders::where('sold', true)->sum('price');
406
```
407
408
+Aggregations can be also used on subdocuments:
409
+
410
+```php
411
+$total = Order::max('suborder.price');
412
+...
413
+```
414
415
+**NOTE**: this aggreagtion only works with single subdocuments (like embedsOne) not subdocument arrays (like embedsMany)
416
417
**Like**
418
419
```php
0 commit comments