path(); $image = Image::make($path); Storage::put($this->getScreenshotPath($timeInterval), (string)$image->encode(self::FILE_FORMAT, self::QUALITY)); GenerateScreenshotThumbnail::dispatch($timeInterval); } public function createThumbnail(TimeInterval|int $timeInterval): void { if (!Storage::exists(self::PARENT_FOLDER . self::THUMBS_FOLDER)) { Storage::makeDirectory(self::PARENT_FOLDER . self::THUMBS_FOLDER); } $image = Image::make(Storage::path($this->getScreenshotPath($timeInterval))); $thumb = $image->resize(self::THUMB_WIDTH, null, fn(Constraint $constraint) => $constraint->aspectRatio()); Storage::put($this->getThumbPath($timeInterval), (string)$thumb->encode(self::FILE_FORMAT, self::QUALITY)); } public function destroyScreenshot(TimeInterval|int $interval): void { Storage::delete($this->getScreenshotPath($interval)); Storage::delete($this->getThumbPath($interval)); } public static function getFullPath(): string { $fileSystemPath = config('filesystems.default'); return storage_path(config("filesystems.disks.$fileSystemPath.root")); } }