Open janboddez opened 3 years ago
Note that I can do the following (based on a regular hasMany relationship between Feed and Entry) just fine:
$entries = $feed->entries()
->orderBy('published', 'desc')
->orderBy('id', 'desc')
->with('feed')
->cursorPaginate();
Stumbled upon https://github.com/yajra/laravel-datatables/issues/2462#issuecomment-701127051, and it seems adding select('entries.*')
to the original code indeed makes it works, too. (No idea why, though.)
I'm seeing this SQL error:
I'm thinking the empty as `` might have something to do with it?Happens when I do:
Where Category has a hasManyThrough relationship with Entry, through Feed (the intermediate model). I.e., an entry belongs to one feed which belongs to one category.
Does not happen when I explicitly do this (i.e., use a
whereHas
condition):According to Debug bar, the following SQL is generated for this last bit of code:
So no
JOIN
, it seems.(The
user_id = 1
is because of a global scope.)