ragingdave / flysystem-sftp-laravel
Integrates Flysystem SFTP with Laravel Storage.
Installs: 15 040
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 2
Open Issues: 0
Requires
- illuminate/filesystem: ~5.0
- illuminate/support: ~5.0
- league/flysystem-sftp: ^1.0
This package is auto-updated.
Last update: 2024-11-15 11:27:25 UTC
README
This package provides a service provider to add the sftp flysystem-driver to Laravel Storage mechanisms.
NOTE
This package is no longer needed in Laravel Version 5.6 and up. See the Laravel Docs for details. https://laravel.com/docs/5.6/filesystem#driver-prerequisites
Installation
In order to install this package, simply require the package
composer require ragingdave/flysystem-sftp-laravel
Laravel version < 5.5
Add the service provider to config/app.php
:
RagingDave\Filesystem\Sftp\SftpServiceProvider::class,
Configuration
To configure an sftp connection, add a new configuration to config/filesystems.php
:
'disks' => [ 'sftp' => [ 'driver' => 'sftp', 'host' => env('SFTP_HOST'), 'port' => env('SFTP_PORT', 22), 'username' => env('SFTP_USERNAME'), 'password' => env('SFTP_PASSWORD'), 'privateKey' => storage_path('keys') . '/sftp_key', // This can also be the full private key contents 'root' => env('SFTP_ROOT'), 'timeout' => env('SFTP_TIMEOUT', 10), ], ],
Additional options that thephpleague/flysystem-sftp
supports can be passed as all options are passed-through to the adapter.