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

Add support for the 'metadata' config option #83

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

diezit
Copy link

@diezit diezit commented Feb 19, 2020

Support for this was added in the main package Superbalist/flysystem-google-cloud-storage, but was not added to this laravel integration yet. This PR fixes that.

The commit that added metadata support to the other repo is Superbalist/flysystem-google-cloud-storage@fedbdca

@felipemeddeiros
Copy link

Could you help me in how to implente a metadata configuration?

@ffflabs
Copy link

ffflabs commented Oct 6, 2020

@felipemeddeiros you can do that already, for example:

     $disk = Storage::disk('gcs');
     $disk->put($filePath, $fileContents, [
            'metadata'=>[
                'cacheControl'=> 'public,max-age=86400',
                'contentType'=> 'image/jpeg'
            ]
     ]);

This PR would allow for a default metadata config applied to every upload which doesn't set an explicit config parameter

'gcs' => [
    'driver' => 'gcs',
    'project_id' => env('GOOGLE_CLOUD_PROJECT_ID', 'your-project-id'),
    ... other keys ...
     'metadata'=>[
           'cacheControl'=> 'public,max-age=86400',
     ]
]

usual metadata entries are described here: https://firebase.google.com/docs/storage/web/file-metadata

Added support for laravel 7.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants