Aaaand.... Just found the answer: Eager loading.
I will just leave this here so if someone is searching for this answer via the same search terms as me, they might be able to find it!
Solution:
$videos = Video::where("videoUserID",$userID)
->with('videoAsset')
->with('thumbnailAsset')
->limit($this->limit)
->offset($this->offset)
->orderBy("created_at", "desc")
->get();
Alternate Solution:
$videos = Video::where("videoUserID",$userID)
->with('videoAsset','thumbnailAsset')
->limit($this->limit)
->offset($this->offset)
->orderBy("videoYouTubePublishedAt", "desc")
->get();
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community