- How do I integrate UniSharp Laravel Filemanager with CKEditor in my Laravel app?
- Use the `filebrowserImageBrowseUrl` and `filebrowserImageUploadUrl` config options in CKEditor’s config to point to the Filemanager’s endpoints. The package provides built-in routes for this purpose. Ensure your CKEditor version is compatible with the Filemanager’s JS integration, which is minimal and requires no additional plugins.
- Does this package support Laravel 10 or 11, and are there breaking changes from older versions?
- UniSharp Laravel Filemanager is tested for Laravel 9+ and supports 10/11, but some features (e.g., new Laravel 11 file system APIs) may require manual adjustments. Check the [upgrade guide](https://unisharp.github.io/laravel-filemanager/upgrade) for version-specific notes. Minor version updates typically maintain backward compatibility.
- Can I use this with AWS S3 or other cloud storage instead of local files?
- Yes, the package leverages Laravel’s filesystem, so it works with any storage driver (S3, GCS, etc.). Configure your `filesystems.php` as usual, and the Filemanager will adapt automatically. For S3, ensure your bucket permissions allow uploads and consider caching thumbnails locally to reduce latency.
- How do I restrict file uploads to specific user folders or roles in Laravel?
- Use Laravel’s auth middleware and policies to gate access. The package supports private folders tied to user IDs by default, but you can override the `ConfigHandler` to use custom fields (e.g., `user_uuid`). Integrate with Spatie’s Laravel-Permission or Gates to enforce role-based restrictions on folder access.
- Will this package slow down my app if I have high-traffic file uploads?
- Thumbnail generation on upload is the primary performance concern. For high volumes, pre-generate thumbnails or use a queue (e.g., Laravel Queues) to offload the task. Cloud storage (S3) may introduce latency; optimize by caching thumbnails or using CDNs for static assets.
- Can I customize the UI or translate the package’s frontend to another language?
- Yes, publish the package’s assets (`php artisan vendor:publish --tag=filemanager-assets`) to override views, CSS, or JS. Translations are also publishable. For deep customization, extend the package’s Blade components or use Alpine.js to modify behavior dynamically without core changes.
- How do I handle file validation (e.g., allowed MIME types, max file size) in Filemanager?
- Validation rules are configurable via the `config.php` file. Use Laravel’s built-in validation rules (e.g., `mimes:jpg,png`, `max:10240`) or extend the `FileUploadRequest` class to add custom logic. For dynamic rules, hook into the `filemanager.uploading` event to modify the request before processing.
- Are there alternatives to UniSharp Laravel Filemanager for simpler file uploads without WYSIWYG?
- For lightweight uploads, consider `laravelista/file-manager` or `spatie/laravel-medialibrary`. These focus on standalone file management without editor integration. If you need CKEditor/TinyMCE support, UniSharp’s package is more feature-rich but heavier. Evaluate your needs: standalone uploads may not require a full gallery.
- How do I test the Filemanager in a CI/CD pipeline or local environment?
- Mock Laravel’s filesystem by binding a custom `Storage` facade in tests. Use `Storage::fake()` for local testing or configure a temporary S3 bucket for cloud storage tests. Test editor integrations by verifying the generated URLs (e.g., `route('filemanager.crop')`) return expected responses.
- What security risks should I watch for when using this package in production?
- Audit file validation to prevent malicious uploads (e.g., PHP scripts disguised as images). Use Laravel’s auth middleware to restrict upload routes, and validate MIME types server-side (client-side checks are bypassable). For shared folders, implement strict access controls via Policies or Gates to avoid unintended exposure.