- How do I install innmind/filesystem in a Laravel project?
- Install it with Composer using composer require innmind/filesystem. It is a framework-agnostic PHP package, so no Laravel service provider is required by the package itself. You can instantiate the filesystem adapter you need and bind it in Laravel's container if you want dependency injection.
- Is innmind/filesystem compatible with Laravel?
- innmind/filesystem is not Laravel-specific, but it can be used inside a Laravel application as a normal Composer dependency. You can wire its adapters and file or directory objects through Laravel's container. It is not a drop-in replacement for Laravel's Storage facade unless you build that integration yourself.
- Which Laravel and PHP versions does innmind/filesystem support?
- The package does not declare Laravel version constraints because it is framework-agnostic. Its PHP version requirement should be checked in the package's composer.json before installing. Any Laravel version running a compatible PHP version can use it.
- How do I read and write files with innmind/filesystem?
- You work through file and directory objects created by an adapter rather than calling raw PHP filesystem functions directly. The API supports read, write, add, remove, and list operations through a consistent object-oriented interface. Composable names and paths help keep file handling safer and more predictable.
- Can I use an in-memory filesystem for tests with innmind/filesystem?
- Yes. The adapter-based design is intended to let you swap the local filesystem for custom or in-memory backends in tests. That means your application code can exercise file and directory operations without touching a real disk. It helps keep tests faster and more isolated.
- How do I list files and directories using innmind/filesystem?
- Directory objects expose listing operations through the package's consistent filesystem API. You can inspect directories and work with their contained files and subdirectories as objects. The exact adapter behavior should be confirmed against the package documentation for your storage backend.
- How do I swap local storage for a custom filesystem adapter?
- Create or configure an adapter that implements the package's filesystem contract and use it to build file and directory objects. Because your application depends on the abstraction rather than a hard-coded disk path, you can change adapters without rewriting file-handling logic. This is the main benefit of the storage-agnostic design.
- Is innmind/filesystem a good alternative to Laravel Storage or Flysystem?
- innmind/filesystem takes a different approach by exposing files and directories as objects through an adapter-based API. Laravel Storage and Flysystem are more commonly integrated into Laravel projects, so evaluate fit based on your need for object-oriented file and directory manipulation. It can complement a Laravel app, but it is not a direct substitute for those tools.
- What production concerns should I check before using innmind/filesystem?
- Review filesystem permissions, path handling, and adapter-specific error behavior before deploying. Since the package abstracts storage, you should also verify that your chosen adapter is reliable under production load. Test critical read, write, remove, and listing operations against realistic storage conditions.
- How is innmind/filesystem maintained and where can I find its documentation?
- Check the package on Packagist and its repository for release history, documentation, and issue activity. The repository location was not provided in the supplied context, so confirm the authoritative source before relying on it. Review recent releases and open issues as part of your package evaluation.