spatie / flysystem-dropbox

A flysystem driver for Dropbox that uses the v2 API
https://freek.dev/734-dropbox-will-turn-off-v1-of-their-api-soon-its-time-to-update-your-php-application
MIT License
343 stars 50 forks source link

how can generate view link which i have to stored in database? #8

Closed vipin733 closed 7 years ago

vipin733 commented 7 years ago

i just install this package and i successfully able to upload image in my dropbox app problem is what should i store image url in databse when i try to reutn $path i got "avatars/X4caB0wH9VwDuOvVP1cdkfdDKX52VzfV8igdCd7c.png" here is my controller method

       $path = $request->file('avatar')->store('avatars','dropbox');
       return $path; 
freekmurze commented 7 years ago

Try this:

Storage::disk('dropbox')->getThumbnail($pathOnDropbox);

You can learn which methods exist by looking at the code of the DropboxAdapter class.

vipin733 commented 7 years ago

i got errors

BadMethodCallException in PluggableTrait.php line 90:
Call to undefined method League\Flysystem\Filesystem::getThumbnail

my method

\Storage::disk('dropbox')->getThumbnail('avatars');
freekmurze commented 7 years ago

Try this: \Storage::disk('dropbox')->getDriver()-->getThumbnail('avatars'); On Sat, 29 Apr 2017 at 10:34, vipin kumar notifications@github.com wrote:

i got errors

BadMethodCallException in PluggableTrait.php line 90: Call to undefined method League\Flysystem\Filesystem::getThumbnail

my method

\Storage::disk('dropbox')->getThumbnail('avatars');

— You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub https://github.com/spatie/flysystem-dropbox/issues/8#issuecomment-298155820, or mute the thread https://github.com/notifications/unsubscribe-auth/AAdiDbvyesGo8fT1s6QRXxbj7j74JDnqks5r0vYQgaJpZM4NMK-g .

-- Freek Van der Herten https://spatie.be +32 495 84 27 91

vipin733 commented 7 years ago
$get =  \Storage::disk('dropbox')->getDriver()->getThumbnail('avatars');
dd($get);

errors

BadMethodCallException in PluggableTrait.php line 90:
Call to undefined method League\Flysystem\Filesystem::getThumbnail
Porkts commented 4 years ago

this works with me: \Storage::getDriver()->getAdapter()->getUrl($imgPath)