cesargb / laravel-magiclink

Create link for authenticate in Laravel without password or get private content
MIT License
359 stars 43 forks source link

How to use Custom Disk #32

Closed Aliakbari1994 closed 3 years ago

Aliakbari1994 commented 3 years ago

I want to get the file from ftp disk and give it to DownloadFileAction(). What can I do to do this?

cesargb commented 3 years ago

You can get file from other disk with action ResponseAction, sample:

$action = new ResponseAction(function () {
    return Storage::disk('ftp')->download('text.txt');
});

$url = MagicLink::create($action)->url;

Although it would be better to incorporate this possibility in the action DownloadFileAction. It would be a good idea to add this functionality.