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 Integration: Perfect fit for Laravel applications using Livewire for dynamic UI. The package leverages Livewire’s reactivity for real-time file operations (e.g., drag-and-drop, previews) without full page reloads, aligning with modern SPAs while staying server-rendered.
  • Spatie Media Library Synergy: Deep integration with Spatie’s medialibrary ensures consistency with existing media handling (e.g., models, storage adapters, conversions). Avoids reinventing file storage/management logic.
  • API-First Design: RESTful API endpoints (/api/filemanager/v1/) enable decoupled access for non-Livewire clients (e.g., mobile apps, third-party services). Uses Laravel Sanctum for auth, reducing boilerplate for secure endpoints.
  • Modularity: Components (e.g., <x-livewire-filemanager />) and API endpoints are self-contained, allowing selective adoption (e.g., use only the UI or only the API).

Integration Feasibility

  • Laravel Ecosystem Compatibility:
    • PHP 8.2+: Requires minimal runtime changes for most Laravel 10/11/12/13 apps.
    • Livewire 3.x: Assumes Livewire is already in use; no conflicts with AlpineJS (used for UI enhancements).
    • TailwindCSS: Optional but recommended for styling. Can be integrated via @filemanagerStyles or configured in tailwind.config.js.
  • Storage Backends: Works with any Spatie-supported storage (local, S3, GCS) via spatie/laravel-medialibrary.
  • Database: Adds two tables (folders, media) with migrations. Minimal schema changes if using Spatie’s medialibrary already.
  • Frontend: Lightweight (~100KB for scripts/styles) with no heavy dependencies beyond Tailwind/Alpine.

Technical Risk

Risk Area Severity Mitigation
Breaking Changes High Package is in v1.0.0 but has undergone renaming (e.g., fileuploaderfilemanager). Use php artisan filemanager:migrate-config to avoid issues.
Security Gaps Medium No built-in auth/ACL by default. Requires manual configuration (Sanctum for API, ACL in livewire-filemanager.php). Critical for public-facing apps.
Performance Medium Thumbnail generation uses queues (default). Poorly configured QUEUE_CONNECTION (e.g., sync) can block requests. Monitor queue workers.
Tailwind Dependency Low Uses PLAY CDN in dev; requires manual config for production. Tailwind v3/4 support ensures flexibility.
API Stability Low API is new (introduced in v1.0.0). Test endpoints thoroughly for versioning risks.
Upgrade Path Medium Migration from v0.x to v1.0.0 is automated but requires filemanager:migrate-config. Plan for future upgrades.

Key Questions for TPM

  1. Security Requirements:
    • Are files publicly accessible (e.g., user uploads) or private (e.g., internal docs)? This dictates ACL/Sanctum setup.
    • Does the app need file-level permissions (e.g., read-only for some users)? ACL must be enabled (acl_enabled: true).
  2. Storage Backend:
    • Is Spatie’s medialibrary already configured? If not, will the team need to set up storage adapters (e.g., S3)?
  3. Scaling Needs:
    • Will thumbnails be generated synchronously (blocking) or asynchronously (queued)? Queue workers must be monitored.
    • Is the API needed for non-Livewire clients (e.g., mobile)? If yes, test Sanctum auth thoroughly.
  4. Customization:
    • Does the UI need branding (e.g., custom colors, logos)? Tailwind overrides or Blade template extensions may be required.
    • Are additional file types (e.g., videos, PDFs) supported? Spatie’s convertImages can be extended.
  5. Compliance:
    • Are there retention policies (e.g., auto-delete old files)? This requires custom logic on Spatie’s Media model.
    • Is audit logging needed for file access? Spatie’s events can be extended to log actions.

Integration Approach

Stack Fit

Component Fit Level Notes
Laravel 10/11/12/13 Excellent PHP 8.2+ support; tested with Livewire 3.x.
Livewire Native Core functionality is Livewire-based (real-time UI updates).
Spatie Media Library High Shared storage/media handling reduces duplication.
TailwindCSS Optional Required for styles but can be customized via tailwind.config.js.
AlpineJS Low Used for minor UI interactions; no critical dependency.
Sanctum Medium Required for API auth; assume Sanctum is already configured.
Queues High Thumbnail generation uses queues; ensure workers are running.

Migration Path

  1. Prerequisites:
    • Laravel 10/11/12/13 with Livewire 3.x.
    • PHP 8.2+.
    • Composer installed.
  2. Installation Steps:
    composer require livewire-filemanager/filemanager
    php artisan vendor:publish --tag=livewire-filemanager-migrations
    php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="medialibrary-migrations"
    php artisan migrate
    
  3. Configuration:
    • Publish config for ACL/API:
      php artisan vendor:publish --tag=livewire-filemanager-config
      php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="medialibrary-config"
      
    • Update media_model in config/medialibrary.php to LivewireFilemanager\Filemanager\Models\Media.
  4. Frontend Setup:
    • Include styles/scripts in Blade:
      @filemanagerStyles
      <x-livewire-filemanager />
      @filemanagerScripts
      
    • For production, replace @filemanagerStyles with local Tailwind paths (see README).
  5. API Access (Optional):
    • Enable Sanctum for API auth.
    • Test endpoints under /api/filemanager/v1/.
  6. Public File Access (Optional):
    • Add route for direct file URLs:
      Route::get('{path}', [FileController::class, 'show'])->where('path', '.*');
      

Compatibility

  • Livewire Version: Tested with Livewire 3.x. Avoid Livewire 2.x.
  • Spatie Media Library: Must be v10.x+. Conflicts may arise with older versions.
  • TailwindCSS: v3/4 supported. v2 may require adjustments.
  • Storage Adapters: Works with any Spatie-supported adapter (local, S3, etc.).
  • Authentication: Sanctum required for API. Manual ACL setup for UI.

Sequencing

  1. Phase 1: Core Integration (1–2 days):
    • Install package, publish migrations/configs, run migrations.
    • Test basic file uploads/deletes in a staging environment.
  2. Phase 2: UI Integration (1 day):
    • Embed <x-livewire-filemanager /> in the app.
    • Customize Tailwind styles if needed.
  3. Phase 3: Security/Hardening (1–3 days):
    • Configure ACL (acl_enabled: true) if needed.
    • Set up Sanctum for API auth.
    • Test file permissions (e.g., user A can’t access user B’s files).
  4. Phase 4: API/Advanced Features (2–5 days):
    • Test API endpoints for non-Livewire clients.
    • Configure queues for thumbnail generation.
    • Implement custom logic (e.g., file retention, audit logs).
  5. Phase 5: Performance Tuning (Ongoing):
    • Monitor queue workers for thumbnail generation.
    • Optimize storage backends (e.g., S3 caching).

Operational Impact

Maintenance

  • Dependencies:
    • Livewire: Updates may require testing for UI compatibility.
    • Spatie Media Library: Critical for file storage; updates should be coordinated.
    • TailwindCSS: Minor updates unlikely to break styles.
  • Package Updates:
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.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata