@TaylorOtwell The ability to paginate/limit eager loaded relationships on a collection.
For example, it would be awesome if something like this was possible:
$users = App\Models\User::with(['posts' => function ($q) {
$q->paginate(10); // or limit
}])->get();
The problem right now is that if I wanted to eager load the "posts" relationship on a "User", you have to load all of them. In some cases, this is not a problem, but if a relationship has possibly 1Ks of associations that's a ton of unnecessary data. I realize this is more of an issue with ORM than it is with Eloquent, but I'm wondering if it's possible to resolve w/ JSON types in the DB.
With Mongo, you can store many-to-many (or one-to-many) relationships right on the associated record. So, the "User" model could have a JSON column (MySQL, MariaDB, PostgreSQL) called "posts" which holds the ID of the post(s) it's associated with (along with any other relevant data such as timestamps). If we had this data available without needing to run another query on a pivot table, I'm wondering if it's possible to paginate/limit relationships on a collection?