isPublic() && class_exists(Files::class)) { $options = $this->getDefaultThumbOptions($options); // Ensure that the thumb exists first parent::getThumb($width, $height, $options); // Return the Files controller handler for the URL $url = Files::getThumbUrl($this, $width, $height, $options); } else { $url = parent::getThumb($width, $height, $options); } return $url; } /** * {@inheritDoc} */ public function getPath(?string $fileName = null): string { $url = ''; if (!$this->isPublic() && class_exists(Files::class)) { $url = Files::getDownloadUrl($this); } else { $url = parent::getPath($fileName); } return $url; } /** * Define the public address for the storage path. */ public function getPublicPath(): string { $uploadsPath = Config::get('cms.storage.uploads.path', '/storage/app/uploads'); if ($this->isPublic()) { $uploadsPath .= '/public'; } else { $uploadsPath .= '/protected'; } return Url::asset($uploadsPath) . '/'; } /** * Define the internal storage path. */ public function getStorageDirectory(): string { $uploadsFolder = Config::get('cms.storage.uploads.folder'); if ($this->isPublic()) { return $uploadsFolder . '/public/'; } return $uploadsFolder . '/protected/'; } /** * Returns the name of the storage disk the file is stored on */ public function getDiskName(): string { return Config::get('cms.storage.uploads.disk'); } }