/** * Get site representative image * * @return Image */ public function getSiteImage() { if (!$this->image && $this->get('uuid')) { $class = $this->storage->createModel(); $files = $class->getByFileable($this->get('uuid')); if (count($files) > 0) { $file = $files instanceof Collection ? $files->first() : current($files); $this->image = $this->media->make($file); } } return $this->image; }