- How do I install Livewire Filemanager in a Laravel project?
- Run `composer require livewire-filemanager/filemanager`, then publish migrations with `php artisan vendor:publish --tag=livewire-filemanager-migrations`. Ensure Spatie Media Library is also configured by publishing its migrations. PHP 8.2+ and Livewire 3.x are required.
- Does Livewire Filemanager work with Laravel 10+?
- Yes, it supports Laravel 10+ and PHP 8.2+. However, check the changelog for updates, as the package is still in active development and may introduce breaking changes before reaching stability.
- Can I use Livewire Filemanager without Livewire in my project?
- No, this package is built specifically for Livewire and requires it to function. If you’re not using Livewire, consider alternatives like Spatie’s Media Library alone or a frontend framework like Vue/React with a custom file manager.
- How do I secure file uploads and prevent unauthorized access?
- Livewire Filemanager does not include built-in authentication. Secure the `/filemanager` routes and API endpoints using Laravel middleware (e.g., `auth`, `can`) or Spatie’s ACL. Avoid exposing sensitive files by validating file paths and using storage policies.
- Does Livewire Filemanager support dark mode and multiple languages?
- Yes, it includes dark mode via TailwindCSS and supports multiple languages through the `resources/lang` directory. You can easily switch themes or add translations by extending the existing language files.
- How do I configure thumbnail generation for uploaded images?
- Thumbnails are generated automatically using Spatie Media Library’s queue system. Ensure your queue worker is running (`php artisan queue:work`) to process thumbnails asynchronously. Customize thumbnail sizes in the Spatie Media Library config.
- Can I access files programmatically via API?
- Yes, the package provides REST API endpoints under `/api/filemanager/v1/`. Use these for mobile apps, microservices, or headless integrations. Secure the API with Sanctum or Passport and validate all inputs to prevent abuse.
- What happens if I already use Spatie Media Library in my project?
- Livewire Filemanager relies on Spatie Media Library for storage. If you’re already using it, ensure the `media_model` config is set correctly to avoid conflicts. The package will reuse your existing Spatie setup.
- How do I customize the UI if I’m not using TailwindCSS?
- The package uses TailwindCSS for styling. If you’re using Bootstrap or another framework, override the CSS in your project’s assets. Expect minor adjustments for components like buttons, modals, or file previews.
- Are there performance concerns with large file volumes?
- For large-scale use, test database performance on the `folders` table. Consider indexing frequently queried columns or offloading files to cloud storage (e.g., S3) if needed. Thumbnail generation uses queues, so ensure workers are robust.