pavlovich4/livewire-filemanager
最新稳定版本:v0.0.1
Composer 安装命令:
composer require pavlovich4/livewire-filemanager
包简介
This package will help to have a livewire file manager
README 文档
README
A modern, responsive file manager for Laravel using Livewire and Alpine.js. Features include:
- Drag and drop file uploads
- Folder management
- Grid and list views
- File previews
- Image thumbnails
- Copy sharing links
- File downloads
Important Requirements
- PHP 8.2 or higher
- Laravel 10.0 or higher
- Livewire 3.0 or higher
- spatie/laravel-medialibrary 10.0 or higher
Caution
Please be sure to install, configure and run migrations of spatie/laravel-medialibrary package before continue. You can review the installation steps at spatie/laravel-medialibrary documentation.
Installation
- Install the package via composer:
composer require pavlovich4/livewire-filemanager
- Publish and run the migrations:
php artisan vendor:publish --tag="livewire-filemanager-migrations"
php artisan migrate
- Publish the config file:
php artisan vendor:publish --tag="livewire-filemanager-config"
- Publish and configure the media library:
php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="medialibrary-config"
Update config/media-library.php:
'custom_path_generators' => [ \Pavlovich4\LivewireFilemanager\Models\File::class => \Pavlovich4\LivewireFilemanager\Support\CustomPathGenerator::class, // or // 'model_morph_alias' => PathGenerator::class ],
- Create the symbolic link for public storage:
php artisan storage:link
Important
This package requires Tailwind CSS along with the @tailwindcss/aspect-ratio and @tailwindcss/forms plugins to be installed and configured in your project.
- Update your Tailwind CSS configuration in
tailwind.config.js:
module.exports = { // ... content: [ // ... './vendor/pavlovich4/livewire-filemanager/resources/views/**/*.blade.php', ], // ... plugins: [ // ... require('@tailwindcss/forms'), require('@tailwindcss/aspect-ratio'), ], };
Usage
- Add the file manager component to your layout:
<livewire:file-manager /> {{-- Or --}} @livewire('file-manager')
- Include the style blade directive in the head tag of your layout:
@livewireFileManagerStyle
- Include the scripts directive at the end of your body:
@livewireFileManagerScript
- Trigger the file manager from any element using the
data-trigger="filemanager"attribute:
<!-- Basic trigger --> <button data-trigger="filemanager">Open File Manager</button>
Configuration
The package configuration file (config/livewire-filemanager.php) allows you to:
return [ // Storage disk to use (default: 'public') 'disk' => 'public', // Media library configuration 'media' => [ 'path_generator' => Pavlovich4\LivewireFilemanager\Support\CustomPathGenerator::class, ], ];
Key Features
File Upload
- Drag and drop support
- Multiple file upload
- Progress indicator
- File type validation
- Size limits (configurable)
Folder Management
- Create folders
- Delete folders (with confirmation)
- Rename folders
- Nested folders
- Folder navigation
File Operations
- Preview files
- Download files
- Delete files
- Rename files
- Copy share links
- File icons based on type
UI Features
- Grid/List view toggle
- Breadcrumb navigation
- Responsive design
- Loading states
- Error handling
Interface Screenshot
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email pavlovebiokou@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-01-16
