Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Filemanager Laravel Package

unisharp/laravel-filemanager

UniSharp Laravel Filemanager adds a responsive web-based file manager to Laravel apps. Browse, upload, organize and delete files and images, integrate with editors like TinyMCE/CKEditor, configure disks, permissions, and customization options.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Pros:

    • Native Laravel Integration: Built on Laravel’s filesystem and event system, ensuring seamless compatibility with Laravel’s ecosystem (e.g., middleware, service providers, and Blade templates).
    • Modular Design: Supports decoupled features (e.g., WYSIWYG editors, standalone uploads, iframe) via configurable routes and middleware, aligning with Laravel’s modularity.
    • Event-Driven: Rich event system (e.g., FileWasUploaded, ImageWasCropped) enables extensibility for custom workflows (e.g., post-upload processing, analytics).
    • Multi-Tenancy Ready: Supports private/shared folders per user, which maps well to Laravel’s auth systems (e.g., Laravel Breeze, Sanctum) and multi-tenant architectures.
    • Cloud Storage Support: Leverages Laravel’s filesystem drivers (S3, FTP, etc.), reducing vendor lock-in and enabling scalable storage backends.
  • Cons:

    • Legacy PHP/Laravel Support: Requires PHP ≥5.4 and Laravel 5.x, which may conflict with modern Laravel (v10+) or PHP (v8+) projects. Risk: Compatibility gaps with newer Laravel features (e.g., Eloquent model events, API resources).
    • Monolithic Core: While modular, the package bundles UI (frontend assets), backend logic, and storage management. Risk: Overhead for projects needing only file uploads without the full gallery.
    • Intervention/Image Dependency: Requires intervention/image (v2/v3), adding another dependency with its own maintenance burden.

Integration Feasibility

  • Stack Compatibility:

    • Frontend: Works with CKEditor, TinyMCE, Summernote (via JS SDKs), and standalone upload buttons. Fit: Excellent for Laravel + Vue/React (via iframe or direct API calls).
    • Backend: Integrates with Laravel’s auth (e.g., auth middleware), queues (for async processing), and filesystem. Fit: High for traditional Laravel apps; may need adapters for API-first or headless setups.
    • Storage: Supports local, S3, FTP, etc. Fit: Ideal for projects already using Laravel’s filesystem.
  • API/Contract Surface:

    • Public API: Exposes routes (e.g., /lfm/upload) and Blade directives (e.g., {{ lfm_upload }}). Risk: Tight coupling to Laravel’s routing system; custom route prefixes may require middleware tweaks.
    • Events: Well-documented events (e.g., FileWasUploaded) allow for custom logic. Fit: Low-risk for extensibility.
    • Configuration: Centralized in config/lfm.php. Fit: Easy to override defaults.

Technical Risk

  • High:

    • Legacy Dependencies: PHP 5.4/Laravel 5.x may require polyfills or forks for modern projects. Mitigation: Evaluate compatibility with Laravel 8+ via testing or wrapper libraries.
    • Storage Permissions: Requires manual chmod/chown for storage/app/public. Risk: Deployment failures if not configured pre-release.
    • Intervention/Image: Image processing relies on GD/Imagick. Risk: Performance bottlenecks with high-resolution images or missing extensions.
    • Multi-User Mode: Private/shared folders assume Laravel’s auth system. Risk: Conflicts with custom auth or multi-tenant setups.
  • Medium:

    • Frontend Assets: Published via lfm_public tag. Risk: Caching issues or conflicts with Laravel Mix/Vite.
    • Event System: Custom listeners may introduce race conditions if not idempotent. Mitigation: Test with async queues.
  • Low:

    • Localization: Supports 30+ locales. Fit: Minimal risk for i18n-heavy apps.
    • Validation: Built-in file type/size validation. Fit: Reduces custom validation logic.

Key Questions

  1. Compatibility:
    • Does the project use Laravel ≥8+ or PHP ≥8.0? If yes, how will legacy dependencies be mitigated (e.g., via Docker, polyfills)?
    • Are custom auth systems (e.g., Passport, Sanctum) in use? If so, how will multi-user folder permissions be mapped?
  2. Performance:
    • Will image processing (cropping/resizing) be offloaded to a queue (e.g., Laravel Horizon)? If not, what are the expected load limits?
    • Is cloud storage (S3) the primary backend? If so, are there costs/latency concerns for frequent uploads?
  3. Extensibility:
    • Are there plans to extend the package (e.g., add video support, custom metadata)? If so, how will events/configs be leveraged?
    • Will the UI be customized (e.g., themes, branding)? If yes, what’s the plan for overriding published assets?
  4. Deployment:
    • Who will manage storage permissions (chmod, storage:link) in CI/CD? Are there automation scripts?
    • Are there backup strategies for user-uploaded files? The package doesn’t include native backup features.
  5. Alternatives:
    • Could simpler solutions (e.g., laravel-filemanager-lite, custom S3 uploads) meet requirements? If not, why is this package a must-have?

Integration Approach

Stack Fit

  • Best For:
    • Traditional Laravel Apps: CMS, blogs, or admin panels using CKEditor/TinyMCE with file management needs.
    • Multi-User Systems: SaaS platforms requiring private/shared file storage per user.
    • Hybrid Stacks: Laravel backend + Vue/React frontend (via iframe or direct API calls to /lfm/upload).
  • Poor Fit:
    • API-First/Headless: Limited native support for direct API consumption (routes are web-focused).
    • Microservices: Monolithic design may not align with service decomposition.
    • Legacy PHP: Projects stuck on PHP <5.6 may face compatibility hurdles.

Migration Path

  1. Assessment Phase:
    • Audit current file storage (e.g., S3, local, FTP) and upload workflows (e.g., manual, third-party tools).
    • Identify gaps (e.g., missing image cropping, no WYSIWYG integration).
  2. Pilot Integration:
    • Install in a staging environment:
      composer require unisharp/laravel-filemanager intervention/image-laravel
      php artisan vendor:publish --tag=lfm_config --tag=lfm_public
      
    • Test with a single WYSIWYG editor (e.g., CKEditor) and a standalone upload button.
  3. Phased Rollout:
    • Phase 1: Replace legacy uploads with the package’s standalone button (low risk).
    • Phase 2: Integrate with WYSIWYG editors (moderate risk; test editor-specific configs).
    • Phase 3: Enable multi-user mode and cloud storage (high risk; validate permissions).
  4. Cutover:
    • Migrate existing files to the new storage structure (e.g., storage/app/public/files/{user-id}/).
    • Update Blade templates to use {{ lfm_upload }} or JS SDKs.

Compatibility

  • Laravel:
    • Supported: Laravel 5.x (tested). Workaround: Use Laravel 8+ with compatibility layers (e.g., laravel-shift/laravel-5-to-8).
    • Unsupported: Laravel 10+ may need patches for route/model event changes.
  • PHP Extensions:
    • Required: exif, fileinfo, GD/Imagick. Mitigation: Containerize or document missing extensions.
  • Frontend:
    • WYSIWYG Editors: Tested with CKEditor, TinyMCE, Summernote. Mitigation: Use the demo as a reference.
    • Custom JS: If using standalone uploads, ensure CORS is configured for API routes.

Sequencing

  1. Pre-Install:
    • Configure APP_URL and storage permissions.
    • Set up intervention/image (v2 or v3) based on Laravel version.
  2. Core Setup:
    • Publish configs/assets and define routes (e.g., /laravel-filemanager).
    • Configure lfm.php for folder categories, multi-user mode, and validation rules.
  3. Editor Integration:
    • For CKEditor:
      config.filebrowserUploadUrl = '/laravel-filemanager/upload';
      config.filebrowserUploadMethod = 'form';
      
    • For TinyMCE:
      tinymce.init({ ... plugins: 'filemanager', ... });
      
  4. Testing:
    • Validate uploads, cropping, and multi-user permissions.
    • Test edge cases (e.g., large files, unsupported MIME types).
  5. Post-Launch:
    • Monitor storage usage and queue jobs (if using async processing).
    • Set up backups for
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai