ivanvermeyen / laravel-google-drive-demo

Laravel & Google Drive Storage - Demo project with Laravel 5.4
403 stars 155 forks source link

Get file metadata #73

Closed bebetoalves closed 4 years ago

bebetoalves commented 4 years ago

Hello, I'm trying to get the metadata from any file (which doesn't necessarily need to be in my account) by id.

My code:

    $fileId = 'any public google drive link id here :)';
    $service = Storage::cloud()->getAdapter()->getService();
    $response = $service->files->get($fileId);
    print_r($response);

But no metadata returns.

I'm using the get method because it's the method that performs such an action according to api documentation. (https://developers.google.com/drive/api/v3/reference/files/get)

Any idea how I can do that? Thank you!