bostjanob / filament-file-manager
Filament 文件管理器
v0.1
2024-02-18 16:50 UTC
Requires
- calebporzio/sushi: ^v2.5
- filament/support: ^3.0
- spatie/laravel-package-tools: ^1.16
README
此包提供了一个 Filament 页面作为简单的文件管理器。
安装
您可以通过 composer 安装此包
composer require bostjanob/filament-file-manager
使用方法
扩展页面类并设置 $disk
属性为您想要管理的磁盘。
<?php namespace App\Filament\Pages; use BostjanOb\FilamentFileManager\Pages\FileManager; class PublicFileManager extends FileManager { protected static ?string $navigationLabel = 'Public files'; protected string $disk = 'public'; }
如果您想更改默认文件夹,则覆盖 $path
属性。
自定义操作
您可以通过覆盖 table
方法来自定义操作。
隐藏按钮
public function table(Table $table): Table { $table = parent::table($table); // actions names: open, download, delete $table->getAction('delete')->hidden(true); return $table; }
添加附加操作
public function table(Table $table): Table { $table = parent::table($table); $table->pushActions([ Action::make('john') ->label('John'), ]); return $table; }
许可证
MIT 许可证 (MIT)。请参阅许可证文件获取更多信息。