-
Notifications
You must be signed in to change notification settings - Fork 146
supplied key param cannot be coerced into a private key #103
Comments
Hey, Any chance you've found a resolution to this? I've run into the same issue. |
I realized the issue only occured when I stored the key in an environment variable, as opposed to just referencing the json file. So I just referenced the json file instead of supplying an array of its values |
Ah I see. I ended up using the private key still, but it turns out Laravel escaped the new lines it read. I just replaced these escaped lines with new lines after reading the env. Thanks for the reply :) |
How'd you do this? |
like this: str_replace('\n', "\n", env('GOOGLE_CLOUD_PRIVATE_KEY')), Make sure your private key is wrapped in quotes in the .env file too. |
Right. Your solution's much more elegant than mine. Thankyou |
I had the same problem. |
My config
When I try storing a file using
Storage:disk('gcs')->putFile('folder', $request->file('example_file'))
I get the error "Supplied key param cannot be coerced into private key. Does anyone know how to get around this? I'm on laravel 7.22.2The text was updated successfully, but these errors were encountered: