- Is nw/sftp-bundle a Laravel package?
- No. nw/sftp-bundle is a Symfony bundle that registers an SFTP client as a Symfony container service. It has no Laravel ServiceProvider, no package auto-discovery, no facade, and no publishable config. In a Laravel app you would only inherit a thin service class wrapping phpseclib-style SFTP calls.
- What is the best SFTP package for Laravel instead?
- league/flysystem-sftp-v3 is the standard choice because it plugs into Laravel's filesystem abstraction and the Storage facade. You can use Storage::disk('sftp')->put(), get(), delete(), and list files with retry helpers and testing fakes. It is maintained and uses phpseclib 3, which avoids the version drift risk of older wrappers.
- How do I install nw/sftp-bundle in a Laravel application?
- Installing it pulls Symfony framework-bundle constraints into your Laravel composer.json, which is the wrong direction for the dependency graph and a likely source of conflicts. A workaround is to require Symfony packages as dev-only, bind the underlying client class as a Laravel singleton, and feed it config('filesystems.disks.sftp'). At that point you are effectively maintaining a fork. Replacing it with flysystem-sftp-v3 is usually faster and safer.
- Does nw/sftp-bundle support modern Laravel and PHP 8.1 or 8.3?
- The last release was 2020-12-22, and it is likely pinned to a phpseclib v2-era dependency. That clashes with PHP 8.1+ and modern Laravel, and resolution may require --ignore-platform-reqs, which is a warning sign. Verify the PHP constraint and phpseclib major version before committing to it.
- How do I configure SFTP credentials in Laravel without this bundle?
- Add an sftp disk in config/filesystems.php with driver sftp, host, username, root path, and either password or private key settings from .env. Then route all transfers through Storage::disk('sftp') instead of hand-rolled connection handling. This keeps credentials out of code and gives you Laravel's normal configuration and caching behavior.
- Can I use nw/sftp-bundle with Laravel's Storage facade?
- No. It exposes a Symfony container service and does not implement a Flysystem adapter, so it will not work with Storage::disk() or Laravel's filesystem fakes. You would call client methods directly and hand-roll the surrounding behavior. flysystem-sftp-v3 is the adapter that gives you Storage integration.
- Does nw/sftp-bundle handle host-key verification and secure authentication?
- That is unclear and risky. A 2020-vintage wrapper is unlikely to have kept pace with host-key verification, OpenSSH versus PEM key formats, and modern algorithm defaults, and unverified host keys are a silent MITM exposure. If compliance requires host-key pinning, evaluate a maintained driver and confirm StrictHostKeyChecking and known_hosts behavior explicitly.
- Is nw/sftp-bundle maintained and safe for production?
- It has 3 stars, 0 dependents, a single maintainer, and no releases since December 2020, so there is no meaningful security response capability. SFTP clients handle credentials and rot quickly as phpseclib and key formats change. It is usable as reference code, not as an adopted production dependency, unless you vendor it and own CVE triage.
- How do I upload, download, list, and delete remote files with nw/sftp-bundle?
- In Symfony you configure a nw_sftp block, let the DI extension build the client service, and inject it where needed. In Laravel you would copy the single client class into app/Support/Sftp, strip the Symfony config and DI code, bind it in a ServiceProvider reading config/sftp.php, and call its transfer methods. The equivalent Storage operations with flysystem-sftp-v3 are put(), get(), delete(), and directory listing calls.
- How do I test SFTP file operations in a Laravel app?
- With flysystem-sftp-v3 you can use Laravel's Storage::fake('sftp') to assert uploads, downloads, and deletes without touching a real server, or mock the underlying client. nw/sftp-bundle provides no Laravel testing fake, so you would have to mock the Symfony service or build your own abstraction. Testing is one of the strongest reasons to use the framework-native path.