Skip to content

Commit

Permalink
Improve README
Browse files Browse the repository at this point in the history
  • Loading branch information
staudenmeir committed Jan 3, 2024
1 parent aaf1a85 commit 4b04a18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ Deep relationships with many-to-many segments can contain duplicate models in th
results, you can remove duplicates from the result collection:

```php
$uniqueComments = Country::find($id)->comments->unique();
$uniqueComments = Country::find($id)->comments()->get()->unique();
```

If you need to remove duplicates in the query (e.g. for pagination), try adding `distinct()`:
Expand Down

0 comments on commit 4b04a18

Please sign in to comment.