Closed ABC2015 closed 7 months ago
Hi @austintoddj - hope the week is progressing well - Just wanted to confirm whether it's the intention to have gcp spatie OOTB (https://github.com/spatie/laravel-google-cloud-storage) integrated - unless we missed something in the docs) - or should we do the wiring ourselves? We have done this in our other Laravel applications - just wanted to get confirmation one way or the other - thanks in advance.
Hi @ABC2015. I haven't tried integrating that package and Canvas. It seems like it should work out of the box, given that it's a pretty generic storage driver.
The URL being returned is that path to the uploaded file, as seen in the upload method here:
public function store()
{
$payload = request()->file();
if (! $payload) {
return response()->json(null, 400);
}
// Only grab the first element because single file uploads
// are not supported at this time
$file = reset($payload);
$path = $file->store(Canvas::baseStoragePath(), [
'disk' => config('canvas.storage_disk'),
]);
return Storage::disk(config('canvas.storage_disk'))->url($path);
}
What's the payload of the first screenshot (POST request to /api/uploads) above?
Hi @austintoddj https://app.screencast.com/Ft01eBio64W1j (Parsed) (Sourced Payload)
@austintoddj uploaded the payload - in this case - the path for the uploads vs what's the actual gcp storage does not match from our test - which results in the image not being found.
@austintoddj we ended implementing it in a different manner. So we'll close this out.
@ABC2015 Thanks for closing the loop here. Apologies, personal life is a bit nuts right now and I wasn't able to dig into this like I intended.
Feel free to open another issue if something comes up.
No worries - all good.
Discussed in https://github.com/austintoddj/canvas/discussions/1373