- What is tmarois/filebase used for?
- Filebase is a flat-file database for Laravel and PHP that stores collections as JSON files. It provides an Eloquent-like query API for creating, filtering, sorting, updating, and deleting records without a database server. It fits prototypes, small apps, internal tools, and simple persistent storage. It is not intended for high write concurrency, multi-tenant isolation, or large datasets.
- How do I install tmarois/filebase in Laravel?
- Install via Composer with composer require tmarois/filebase. The package includes a Laravel service provider and facade for older Laravel versions. On modern Laravel and PHP 8+ stacks, expect to fork and patch compatibility before production use. After installation, configure or publish storage paths as needed.
- Does Filebase support Laravel 9, 10, or 11?
- Filebase's last release was February 2019 and predates Laravel 6+, so Laravel 9-11 support is not guaranteed. Developers typically need a maintained fork or compatibility spike to address service provider, facade, and PHP 8 issues. Do not assume stock compatibility on current Laravel versions.
- Is tmarois/filebase compatible with PHP 8?
- No verified PHP 8 compatibility is provided; the package was last released in 2019 and predates PHP 8 hardening. You may encounter deprecations, typed-property issues, or other runtime errors. Treat PHP 8.1+ use as a fork-and-patch dependency and test thoroughly.
- How does Filebase store data?
- It stores each collection as a human-readable JSON file on the filesystem. Writes typically rewrite the full file, using filesystem locking rather than a write-ahead log or multi-file transactions. This makes data easy to inspect and back up but vulnerable to corruption or lost updates during crashes or lock contention.
- Is Filebase safe for production use?
- For small, single-node, read-mostly datasets with backups and serialized writes, it can be acceptable with documented risk acceptance. It lacks transactions, WAL, multi-tenant isolation, and high-concurrency write safety. The package is archived and unmaintained, so security patches and framework updates are your responsibility. Many teams restrict it to prototypes or internal tools.
- What are good alternatives to Filebase for Laravel?
- SQLite is the closest zero-ops alternative and is first-class in Laravel, offering better durability and concurrency. For larger or multi-writer workloads, use MySQL or PostgreSQL. If you only need simple key-value settings, Laravel's cache or config files may suffice. Filebase's main differentiator is human-readable per-file JSON storage.
- How do I test code that uses Filebase?
- Code against a repository interface so you can swap Filebase for an in-memory or SQLite implementation in tests. For integration tests, point Filebase at a temporary directory and clean it between runs. Avoid relying on shared production paths. Because the package is unmaintained, pin versions and test PHP and Laravel upgrades in a spike.
- Can Filebase handle concurrent writes or multiple servers?
- Filebase relies on local filesystem locking and is designed for single-node, single-writer use. Multi-instance or container-replicated deployments with shared filesystems can break locking assumptions and cause lost updates. For concurrent writers or horizontal scaling, use SQLite with appropriate settings or a server database.
- Is tmarois/filebase maintained, and what license does it use?
- The package is archived, with its last release in February 2019, so it is effectively unmaintained. Composer and security audit tools may flag it as abandoned; plan a documented exception or fork. It is MIT licensed, which is permissive for commercial use, modification, and redistribution.