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

Driver [gcs] is not supported. #95

Open
aCodeAlchemist opened this issue Jul 28, 2020 · 3 comments
Open

Driver [gcs] is not supported. #95

aCodeAlchemist opened this issue Jul 28, 2020 · 3 comments

Comments

@aCodeAlchemist
Copy link

aCodeAlchemist commented Jul 28, 2020

I am trying to access last modified date of a particular file:

$disk = Storage::disk('gcs');
$info = $disk->lastModified('file.jpg');

And I am getting the error I mentioned in title.

I am Using following version for libraries:

    "php": "^7.2.5",
    "fideloper/proxy": "^4.2",
    "fruitcake/laravel-cors": "^2.0",
    "guzzlehttp/guzzle": "^6.3",
    "laravel/framework": "^7.0",
    "laravel/horizon": "^4.3",
    "laravel/tinker": "^2.0",
    "predis/predis": "^1.1",
    "sentry/sentry-laravel": "^1.8",
    "superbalist/laravel-google-cloud-storage": "^2.2.3"

And I have configured filesystems.php as mentioned below:

'disks' => [
    'gcs' => [
        'driver' => 'gcs',
        'project_id' => env('GOOGLE_CLOUD_PROJECT_ID', 'your-project-id'),
        'key_file' => env('GOOGLE_CLOUD_KEY_FILE', public_path('production.json')), // optional: /path/to/service-account.json
        'bucket' => env('GOOGLE_CLOUD_STORAGE_BUCKET', 'your-bucket'),
        'path_prefix' => env('GOOGLE_CLOUD_STORAGE_PATH_PREFIX', null), // optional: /default/path/to/apply/in/bucket
        'storage_api_uri' => env('GOOGLE_CLOUD_STORAGE_API_URI', null), // see: Public URLs below
        'visibility' => 'public', // optional: public|private
    ],
]

I have tried clearing cache and config

php artisan config:clear
php artisan cache:clear

It still doesn't work.

What am I doing wrong? Am I missing anything?

@Rkallenkoot
Copy link

Looks like the package Service Provider isn't being loaded.

Have you tried running php artisan package:discover or manually registering the Service Provider in config/app.php under

'providers' => [
        ...
]

composer dump-autoload should also trigger the php artisan package:discover

@DieterHolvoet
Copy link

DieterHolvoet commented Dec 28, 2020

Same issue here. When running artisan package:discover I get the following:

Discovered Package: superbalist/laravel-google-cloud-storage
Package manifest generated successfully.

After manually adding the service provider to config/app.php it works.

@Airgerr
Copy link

Airgerr commented Jun 20, 2022

Seems like a composer related issue. It was not registering the package. It did work before.
After installing the lib again it worked...

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

No branches or pull requests

4 participants