Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants