Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Implement temporaryUrl method #67

Open
fosron opened this issue Jul 16, 2019 · 0 comments
Open

Implement temporaryUrl method #67

fosron opened this issue Jul 16, 2019 · 0 comments

Comments

@fosron
Copy link

fosron commented Jul 16, 2019

It was mentioned previously (#35), but now the official adapters like S3 and Rackspace have the capabilities built-in as:

\Illuminate\Filesystem\FilesystemAdapter::temporaryUrl

public function temporaryUrl($path, $expiration, array $options = [])
    {
        $adapter = $this->driver->getAdapter();

        if ($adapter instanceof CachedAdapter) {
            $adapter = $adapter->getAdapter();
        }

        if (method_exists($adapter, 'getTemporaryUrl')) {
            return $adapter->getTemporaryUrl($path, $expiration, $options);
        } elseif ($adapter instanceof AwsS3Adapter) {
            return $this->getAwsTemporaryUrl($adapter, $path, $expiration, $options);
        } elseif ($adapter instanceof RackspaceAdapter) {
            return $this->getRackspaceTemporaryUrl($adapter, $path, $expiration, $options);
        } else {
            throw new RuntimeException('This driver does not support creating temporary URLs.');
        }
    }

It should be possible to implement this in the adapter for GCS.

fosron added a commit to fosron/laravel-google-cloud-storage that referenced this issue Oct 14, 2019
Superbalist#67 this is already available from Flysystem package.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants