I have a small gallery, it has two types of pictures, one is a preview, the other is a regular one, it opens when you click on the preview.
Here is this code, which is on line 173 of the controller:
$model = Gallery::getActive()->where(['code' => $code])->with(
[
'itemsPhoto' => static function (ActiveQuery $query) {
$query->with(['photo', 'preview']);
}
]
)->one();
So, I opened DB debug to look at the requests for this gallery, and I got this:
I have two pictures in my gallery right now. That is, for each picture there is a separate request (preview and regular).
How can I make requests for all pictures in the gallery not come separately, but all together, in one request, should this be done in the controller in this line or in another place?
