-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
Hello guys, I'm trying to limit a many to many relationship with the following code:
$latest = Manga::including(['chapters' => function($q) {
$q->descending('number');
$q->limit(1);
}])->limit(24)->all();query result:
[
...
{
...
updated_at: "2020-10-29 21:41:13",
chapters: [ ] //empty
},
{
...
updated_at: "2020-10-29 21:41:39",
chapters: [
{
id: "1528",
number: "398",
name: "",
manga_id: "5",
created_at: "2020-10-29 21:42:50",
updated_at: "2020-10-29 21:42:50"
}
}
]but it only work for 1 manga record with id 5, I don't know whats wrong, can u guys tell me?
P.S: sorry bad english.