There is page template “product”, which contains files sections with 3 different file templates (product photos, drawings photos, detailes photos). I need to show first image of “product photos” as thumb in panel. Using this model:
class CategoryPage extends Page
public function cover()
return $this->content()->get('cover')->toFile() ?? $this->files()->filterBy('template','productphotos')->sortBy('sort', 'asc')->first();
It works well for templates, but in panel shows first image of all images. How to make filter by file tempalte work in panel?