Overview
Flysystem is a filesystem abstraction library for PHP. It allows an application to work with files through a common API while the underlying storage may be local or provided by a supported adapter.
Why use an abstraction
A storage abstraction can reduce coupling between business logic and a specific storage provider. It is useful for upload workflows, generated documents, backups and applications that may move files between local and remote storage.
Integration approach
Install the core package and the adapter required by the project. Configure storage credentials outside public source files, define allowed paths and use the library's operations for writing, reading, listing and deleting files.
Security considerations
Never trust user-supplied file paths or names. Validate file types and sizes, generate server-side names, restrict access to private storage and ensure that remote credentials have only the permissions the application needs.