/** * Return a file preview. * * @param int $width * @param int $height * @return string */ public function thumbnail($width = 64, $height = 64) { if ($this->type() == 'image') { return $this->object->image()->fit($width, $height)->output(); } $type = $this->dispatch(new GetType($this->object)) ?: 'document'; return $this->image->make('anomaly.module.files::img/types/' . $type . '.png')->height($height)->image(); }
/** * Return a file preview. * * @param int $width * @param int $height * @return string */ public function preview($width = 48, $height = 48) { if ($this->type() == 'image') { return $this->object->image()->fit($width, $height)->class('img-rounded')->output(); } $type = $this->dispatch(new GetType($this->object)) ?: 'document'; return $this->image->make('anomaly.module.files::img/types/' . $type . '.png')->height($height)->image(); }
/** * Return a file preview. * * @param int $width * @param int $height * @return string */ public function preview($width = 48, $height = 48) { if (in_array($this->object->getExtension(), $this->config->get('anomaly.module.files::mimes.thumbnails'))) { return $this->object->image()->fit($width, $height)->class('img-rounded'); } $type = $this->dispatch(new GetType($this->object)) ?: 'document'; return $this->image->make('anomaly.module.files::img/types/' . $type . '.png')->height($height)->image(); }