ivanvermeyen / laravel-google-drive-demo

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

Getting webContentLink for file #22

Closed chrisbell08 closed 6 years ago

chrisbell08 commented 6 years ago

Can we pass in custom field lists on the list request so I can access the webContentLink for a file

chrisbell08 commented 6 years ago

Ok so after doing more digging around we do request the webContentLink but it returns null from the google drive adapter. However to google client.php file does return the webContentLink in the execute method so somewhere along the line it's not getting added to the Google_Service_Drive_DriveFile object. dumping out the setWebContentLink() doesn't do anything so I guess that's not being called

chrisbell08 commented 6 years ago

Fixed by adding:

$result['webContentLink'] = $object->getWebContentLink();

To line 814 of the google drive adapter

ivanvermeyen commented 6 years ago

Nice catch! This seems more an issue for the original GoogleDriveAdapter repo: https://github.com/nao-pon/flysystem-google-drive

Perhaps you can report your findings there so they can add it, or even do a pull request if you're comfortable with that?

👍

chrisbell08 commented 6 years ago

Will Do :)