An extension to the flysystem Sftp adapter that allows you to configure a public URL for files to be accessible from.

dev-master 2017-05-02 15:08 UTC

This package is auto-updated.

Last update: 2020-03-19 22:16:01 UTC


An extension to the sftp flysystem adapter that allows you to configure a public URL for files to be accessible from.

build status Total Downloads coverage report License


The default sftp flysystem adapter does not have a method to get the URL of files on the disk, instead a if you try and call the url() method on the disk instance a RuntimeException will be thrown.

I wrote this extension to the sftp adapter so that i could upload files using my media-manager package and store the files on a remote server yet still have them in a publicly accessible place.


To get started, install public sftp adapter via the Composer package manager:

composer require talvbansal/laravel-public-sftp

Register the adapter in the providers array of your config/app.php configuration file:


After this a new disk will be automatically registered called public-sftp.


Add the relevant configuration from the keys below to access your ssh enabled server:


The new value to pay attention to here is SFTP_PUBLIC_ROOT which should be a publicly accessible URL that is serving the contents of the SFTP_ROOT folder.

So if you were using nginx or apache to serve the /var/www/public folder on a server over https on a domain of example.com the values would look like this:


You can now use the public-sftp disk as a filesystem within laravel and will be able to call the url() method on the disk instance to get a publicly accessible URL of an uploaded file.



The MIT License (MIT). Please see License File for more information.