bostjanob / filament-file-manager
Filament File Manager
v0.1
2024-02-18 16:50 UTC
Requires
- calebporzio/sushi: ^v2.5
- filament/support: ^3.0
- spatie/laravel-package-tools: ^1.16
README
This package provides a Filament page as a simple file manager.
Installation
You can install the package via composer:
composer require bostjanob/filament-file-manager
Usage
Extend the page class and set $disk
property to the disk you want to manage.
<?php namespace App\Filament\Pages; use BostjanOb\FilamentFileManager\Pages\FileManager; class PublicFileManager extends FileManager { protected static ?string $navigationLabel = 'Public files'; protected string $disk = 'public'; }
If you want to change default folder, override the $path
property.
Customizing actions
You can customize the actions by overriding the table
method.
Hiding button:
public function table(Table $table): Table { $table = parent::table($table); // actions names: open, download, delete $table->getAction('delete')->hidden(true); return $table; }
Adding addition action:
public function table(Table $table): Table { $table = parent::table($table); $table->pushActions([ Action::make('john') ->label('John'), ]); return $table; }
License
The MIT License (MIT). Please see License File for more information.