Skip to content

Commit

Permalink
Restore note about including IDs in relation queries
Browse files Browse the repository at this point in the history
  • Loading branch information
bennothommo committed Oct 8, 2024
1 parent 3bf9f31 commit fcd6438
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions database/relations.md
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,8 @@ select * from books
select * from authors where id in (1, 2, 3, 4, 5, ...)
```

> **NOTE:** If you are selecting specific columns in your query and want to load relationships as well, you need to make sure that the columns that contain the keying data (i.e. `id`, `foreign_key`, etc) are included in your select statement. Otherwise, Winter cannot connect the relations.
### Eager loading multiple relationships

Sometimes you may need to eager load several different relationships in a single operation. To do so, just pass additional arguments to the `with` method:
Expand Down

0 comments on commit fcd6438

Please sign in to comment.