- What is laravel-liberu/files used for?
- It is a Laravel package for managing files and uploads in Liberu applications. It provides a clean API for storing, organizing, and retrieving file attachments, and it integrates with Laravel's filesystem and storage drivers. Use it when you need uploads, file metadata, and model associations handled consistently in a Laravel app.
- How do I install laravel-liberu/files?
- Install it with Composer using composer require laravel-liberu/files. Then follow the repository README for any service provider registration, configuration publishing, migrations, or asset steps. Because package setup can change between releases, verify the exact commands against the README for your installed version.
- Which Laravel versions does laravel-liberu/files support?
- The repository and its composer.json are the authoritative source for supported Laravel and PHP versions. Check those constraints before installing, especially if you are on the newest Laravel release or upgrading a major version. The package is designed for Laravel applications, but you should confirm compatibility rather than assuming support for every Laravel version.
- How does laravel-liberu/files integrate with Laravel filesystem and storage drivers?
- It uses Laravel's filesystem layer and storage disks, so uploads can be handled by any driver Laravel supports, such as local storage or S3-compatible disks. You configure disks in config/filesystems.php and the package uses those settings for storing and retrieving files. This keeps file operations consistent with the rest of your Laravel application.
- Can I attach files to multiple Eloquent models with laravel-liberu/files?
- Yes, the package is intended for file associations across your models and provides an API for attaching and retrieving files. The exact relation names and methods should be taken from the package README and source for your version. This lets multiple Eloquent models reference managed uploads without each model reimplementing file handling.
- How do I configure storage disks for laravel-liberu/files uploads?
- Configure your upload disk in config/filesystems.php and set the default or package-specific disk according to the README. Ensure the storage directory permissions and any cloud credentials are correct for your environment. The package delegates storage operations to Laravel, so disk behavior follows Laravel's filesystem configuration.
- Does laravel-liberu/files handle file metadata?
- Yes, the package handles file metadata as part of managing uploads and attachments, alongside the stored file itself. You can use its API to retrieve file records and associations, but the exact metadata fields depend on the package migrations and version. Check the README and schema to see which attributes are available for your use case.
- How do I test file uploads with laravel-liberu/files?
- Use Laravel's testing tools, especially Storage::fake for the disk and UploadedFile::fake for uploads, to avoid touching real storage. Then exercise the package's upload and association API in feature tests and assert that files and records are stored as expected. Check the package tests and README for any package-specific helpers or setup.
- Is laravel-liberu/files suitable for production use?
- It can be suitable for production when you configure a reliable disk, validate uploads, set correct permissions, and plan backups or lifecycle rules. Review how your app handles large files, public versus private access, and any queueing needs. Because it builds on Laravel's filesystem, production behavior largely depends on your disk and application configuration.
- What are alternatives to laravel-liberu/files?
- Alternatives include Spatie Laravel Media Library, Laravel's native Storage API with custom model columns, or a custom attachment model tailored to your domain. Choose laravel-liberu/files when you want its Liberu-oriented API for uploads, metadata, and model associations. Compare maintenance activity, Laravel version support, and feature fit before adopting it in a long-lived project.