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

Filemanager Laravel Package

livewire-filemanager/filemanager

Livewire-powered file manager for Laravel: drag & drop uploads, search, folders, dark mode, multi-language UI, and API endpoints. Integrates with Spatie Media Library for media handling and thumbnails. PHP 8.2+.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Livewire-Centric Design: The package is optimized for Livewire, aligning perfectly with Laravel applications using Livewire for dynamic UI. It leverages Livewire’s reactivity for real-time file operations (e.g., drag-and-drop, previews) without full page reloads.
  • Spatie Media Library Integration: Built on top of Spatie’s Media Library, ensuring compatibility with existing Laravel media-handling workflows (e.g., models, collections, conversions). This reduces redundancy and leverages battle-tested storage logic.
  • Modular API Layer: The REST API (Sanctum-authenticated) enables decoupled file management for non-Livewire clients (e.g., mobile apps, third-party services). This fits microservices architectures or headless Laravel setups.
  • Event-Driven Extensibility: Uses Laravel’s events (e.g., MediaCreated, FolderDeleted) for custom logic (e.g., logging, notifications). Ideal for teams needing to hook into file operations without modifying core package code.

Integration Feasibility

  • Low Friction for Laravel Apps: Requires only Livewire and Spatie Media Library, both widely adopted in Laravel ecosystems. Minimal boilerplate (e.g., migrations, routes) reduces integration time.
  • TailwindCSS/AlpineJS Dependency: Assumes these are already in the stack. If not, adds ~500KB for scripts/styles (Tailwind CDN in dev; configurable for production).
  • Storage Agnostic: Works with local, S3, or custom storage via Spatie’s drivers. No vendor lock-in to specific cloud providers.
  • Blade Component Integration: Simple <x-livewire-filemanager /> inclusion, but requires proper Tailwind config for production (avoiding Play CDN). Tailwind v3/v4 support ensures flexibility.

Technical Risk

  • Pre-Stable Maturity: Marked as "still in development" (v1.0.0 is stable but breaking changes exist). Risk of API/config shifts in minor updates. Mitigate by:
    • Pinning versions in composer.json (e.g., ^1.0).
    • Monitoring the GitHub Issues for breaking changes.
  • Security Gaps: No built-in security layers (e.g., file type validation, virus scanning). Critical for production:
    • Implement custom validation in FileController (e.g., mimes:['jpg','pdf']).
    • Use Laravel Policies or Gates for access control.
    • Disable public file access (assets.show route) unless explicitly needed.
  • Performance Overhead:
    • Thumbnail generation uses queues by default. Ensure queue workers are running (e.g., php artisan queue:work).
    • Large file uploads may hit PHP limits (e.g., upload_max_filesize, post_max_size). Adjust php.ini or use chunked uploads (e.g., Livewire Dropzone).
  • ACL Complexity: Enabling ACL requires config publishing and Spatie Media Library setup. Risk of misconfiguration leading to permission errors. Test thoroughly with:
    • php artisan vendor:publish --tag=livewire-filemanager-config
    • php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="medialibrary-config"

Key Questions for Stakeholders

  1. Security Requirements:
    • Are files publicly accessible (e.g., user uploads) or private (e.g., internal documents)? This dictates whether to expose the assets.show route.
    • Do we need file type restrictions (e.g., block .exe) or virus scanning? If yes, custom middleware is required.
  2. Scaling Needs:
    • Will file volumes exceed 10K+ files? Consider database indexing (e.g., folders table) or read replicas for Spatie Media Library.
    • Is real-time collaboration needed (e.g., concurrent edits)? The package lacks built-in WebSocket support; evaluate Laravel Echo for extensions.
  3. API Usage:
    • Will non-Livewire clients (e.g., mobile apps) use the API? If yes, document authentication flow (Sanctum) and rate limits.
  4. Localization:
    • Are additional languages needed beyond English/Spanish/Portuguese? Contribute translations or extend the resources/lang structure.
  5. Customization:
    • Are UI tweaks (e.g., branding, layout) required? The package uses Blade components, so overrides are possible via publishing views:
      php artisan vendor:publish --tag=livewire-filemanager-views
      
  6. Backup/Recovery:
    • How will file deletions be handled? Spatie Media Library supports soft deletes, but confirm backup strategies for critical data.

Integration Approach

Stack Fit

Component Compatibility Notes
Laravel 10.x–13.x (PHP 8.2+) Tested on Laravel 13; ensure config/app.php includes LivewireFilemanager\Filemanager\FilemanagerServiceProvider.
Livewire 3.x Core dependency; no version conflicts expected.
Spatie Media Lib 11.x Critical for file storage. Ensure spatie/laravel-medialibrary is installed (^11.0).
TailwindCSS 3.x/4.x Required for styles. Configure tailwind.config.js to include package views.
AlpineJS 3.x Used for dynamic UI elements (e.g., modals).
PHP Extensions fileinfo, gd (for thumbnails), pdo Verify these are enabled in php.ini.
Databases MySQL, PostgreSQL, SQLite (Spatie Media Library supported DBs) No additional schema changes beyond Spatie’s migrations.
Queues Database, Redis, etc. (Laravel supported) Thumbnail generation uses queues; configure QUEUE_CONNECTION in .env.
Storage Local, S3, FTP, etc. (Spatie drivers) Works with any Spatie-supported storage.

Migration Path

  1. Prerequisite Setup:

    • Install dependencies:
      composer require livewire/livewire spatie/laravel-medialibrary livewire-filemanager/filemanager
      
    • Publish Spatie migrations/config:
      php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="medialibrary-migrations"
      php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="medialibrary-config"
      
    • Run migrations:
      php artisan migrate
      
  2. Package Integration:

    • Publish Livewire Filemanager migrations/config:
      php artisan vendor:publish --tag=livewire-filemanager-migrations
      php artisan vendor:publish --tag=livewire-filemanager-config
      
    • Configure Tailwind (add to tailwind.config.js):
      content: [
          './resources/**/*.blade.php',
          './vendor/livewire-filemanager/filemanager/resources/views/**/*.blade.php',
      ]
      
    • Include styles/scripts in Blade:
      @filemanagerStyles
      <!-- ... -->
      @filemanagerScripts
      
  3. Optional Features:

    • Public File Access: Add route (if needed):
      Route::get('{path}', [\LivewireFilemanager\Filemanager\Http\Controllers\Files\FileController::class, 'show'])
           ->where('path', '.*')
           ->name('assets.show');
      
    • ACL: Enable in config/livewire-filemanager.php:
      'acl_enabled' => true,
      
      Update Spatie’s media_model to LivewireFilemanager\Filemanager\Models\Media.
  4. Post-Installation:

    • Test file uploads, folder creation, and API endpoints.
    • Verify thumbnail generation (ensure queue workers are running):
      php artisan queue:work
      

Compatibility Considerations

  • Livewire 2.x: Not supported (package requires Livewire 3.x). If using Livewire 2, evaluate alternatives like Filament Tables.
  • Legacy Laravel: Versions <10.x may require composer overrides or custom event handling due to
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