token); $this->adapter = new DropboxAdapter($client); $this->filesystem = new Filesystem($this->adapter, ['case_sensitive' => false]); } public function storeUploadedFile(UploadedFile $file, User $uploader): Song { return DB::transaction(function () use ($file, $uploader): Song { $result = $this->scanUploadedFile($file, $uploader); $song = $this->scanner->getSong(); $key = $this->generateStorageKey($file->getClientOriginalName(), $uploader); $this->filesystem->write($key, File::get($result->path)); $song->update(['path' => "dropbox://$this->folder/$key"]); File::delete($result->path); return $song; }); } public function getSongPresignedUrl(Song $song): string { return $this->adapter->getUrl($song->storage_metadata->getPath()); } }