定制 mydnic/filament-file-browser 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mydnic/filament-file-browser

Composer 安装命令:

composer require mydnic/filament-file-browser

包简介

A S3-compatible file browser to list, delete and upload files on any configured disks

README 文档

README

A clean and modern file browser plugin for Filament that allows you to browse, upload, and manage files across different filesystem disks, including S3 buckets. The interface mimics traditional OS file explorers like Dolphin on Linux.

Features

  • 🗂️ Multi-disk Support: Browse files on any configured Laravel filesystem disk (local, S3, etc.)
  • 📁 Folder-first Listing: Displays folders first, then files (like traditional file explorers)
  • Multi-selection: Select multiple files/folders with checkboxes for bulk operations
  • 📤 File Upload: Upload files directly to the current directory
  • 📥 Download: Download individual files or multiple files as ZIP
  • 🗑️ Delete: Delete files and folders with confirmation
  • 🔗 Open in New Tab: Open files in a new browser tab
  • 🧭 Breadcrumb Navigation: Easy navigation through directory structure
  • 🎨 Native Filament Components: Uses Filament's native UI components for consistency

Installation

Install the package via Composer:

composer require mydnic/filament-file-browser

Publish the configuration file:

php artisan vendor:publish --tag="filament-file-browser-config"

Usage

Register the Plugin

Add the plugin to your Filament panel in your PanelProvider:

use Mydnic\FilamentFileBrowser\FilamentFileBrowserPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ... other configuration
        ->plugins([
            FilamentFileBrowserPlugin::make(),
        ]);
}

Configuration

The plugin can be configured via the published configuration file config/filament-file-browser.php:

return [
    // The default disk to use when the file browser is first loaded
    'default_disk' => 'public',

    // Navigation settings
    'navigation_group' => 'Files',
    'navigation_sort' => 0,

    // Temporary directory for zip downloads
    'temp_directory' => storage_path('app/temp'),

    // Maximum upload file size in MB
    'max_upload_size' => 10,

    // Allowed file extensions for upload (empty array means all extensions are allowed)
    'allowed_extensions' => [],

    // Disks to show in the file browser (empty array means all disks are shown)
    'disks' => [],
];

Filesystem Configuration

Make sure your filesystem disks are properly configured in config/filesystems.php. For S3:

'disks' => [
    's3' => [
        'driver' => 's3',
        'key' => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_SECRET_ACCESS_KEY'),
        'region' => env('AWS_DEFAULT_REGION'),
        'bucket' => env('AWS_BUCKET'),
        'url' => env('AWS_URL'),
        'endpoint' => env('AWS_ENDPOINT'),
        'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
    ],
],

Architecture

The plugin follows a clean, modern architecture:

  • FileBrowserPage: Main Filament page using native components
  • FileBrowserService: Handles all file operations (upload, delete, zip creation)
  • Native Filament Components: Uses Filament's built-in form components, actions, and UI elements
  • Custom Table View: Only the file browser table uses a custom Blade view for optimal UX

Requirements

  • PHP 8.1+
  • Laravel 10.0+
  • Filament 3.0+

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 718
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固