Closed scritrolf closed 7 months ago
I dug around a bit and found a solution in another issue here:
return $model->newQuery()->with('descriptionde')->with('category')->select('items.*');//->with('category');
I'm not really sure why this is needed but it's solved now :)
Summary of problem or feature request
Hi, I have a model that has a number of relationships and I want to have the data of more than one these relationships available. So I use with() to eager load the relationships, but this seems to be working just for one relationship, no method chaining is possible
Code snippet of problem
is what I'm trying to achieve but no matter what order I try them, it always only loads the "category" relationship. If I work with only one "with(...)", the specific relationship works.
Operating System curren sail setup Linux 4b31dc42b2ce 6.5.0-18-generic #18~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Feb 7 11:40:03 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
PHP Version php 8.3
Laravel Version "name": "laravel/framework", "version": "v10.44.0",
Laravel-Datatables Version "name": "yajra/laravel-datatables", "version": "v10.1.0",