PHP code example of spatie / laravel-google-cloud-storage
1. Go to this page and download the library: Download spatie/laravel-google-cloud-storage library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
spatie / laravel-google-cloud-storage example snippets
'gcs' => [
'driver' => 'gcs',
'key_file_path' => env('GOOGLE_CLOUD_KEY_FILE', null), // optional: /path/to/service-account.json
'key_file' => [], // optional: Array of data that substitutes the .json file (see below)
'project_id' => env('GOOGLE_CLOUD_PROJECT_ID', 'your-project-id'), // optional: is ORAGE_API_ENDPOINT', null), // set storageClient apiEndpoint
'visibility' => 'public', // optional: public|private
'visibility_handler' => null, // optional: set to \League\Flysystem\GoogleCloudStorage\UniformBucketLevelAccessVisibility::class to enable uniform bucket level access
'metadata' => ['cacheControl' => 'public,max-age=86400'], // optional: default metadata
],