infinety-es / filemanager
Laravel 5 文件管理器
2.3.2
2018-03-01 09:49 UTC
Requires
- php: >=5.5.9
- chumper/zipper: 1.0.x
Requires (Dev)
- phpunit/phpunit: 4.*
README
Laravel 5 自定义文件管理器
变更日志
v2.3 - Laravel 5.5 的自动加载提供者
v2.1 - 现在您可以压缩图片(jpg 或 png)。上传和右键菜单选项也自动进行。
v2 - 您可以使用您原始的 Laravel 5 文件。多个修复和附加功能。
安装
首先需要此包
composer require infinety-es/filemanager
在 ‘app.php’ 中添加提供者
Infinety\FileManager\FileManagerServiceProvider::class,
Zipper
别名从 `FileManagerServiceProvider` 自动加载(下载压缩包格式的文件夹需要此功能)
发布配置、视图和公共文件
php artisan vendor:publish --provider="Infinety\FileManager\FileManagerServiceProvider"
然后您需要修改在新的 filemanager.php
选项中的选项
<?php return array( /* |-------------------------------------------------------------------------- | Path home for your file manager |-------------------------------------------------------------------------- | */ 'homePath' => public_path(), /* |-------------------------------------------------------------------------- | Default routes for your file manager. You can modify here: |-------------------------------------------------------------------------- | */ 'defaultRoute' => 'admin/filemanager', /* |-------------------------------------------------------------------------- | User middleware. You can use or single string or array based |-------------------------------------------------------------------------- | */ 'middleware' => ['web', 'auth'], /* |-------------------------------------------------------------------------- | Use this options if you want to sanitize file and folder names |-------------------------------------------------------------------------- | */ 'validName' => true, /* |-------------------------------------------------------------------------- | Files You don't want to show on File Manager |-------------------------------------------------------------------------- | */ 'exceptFiles' => array( 'robots.txt', 'index.php', '.DS_Store', '.Thumbs.db'), /* |-------------------------------------------------------------------------- | Folders names you don't want to show on File Manager |-------------------------------------------------------------------------- | */ 'exceptFolders' => array( 'vendor', 'thumbs', 'filemanager_assets'), /* |-------------------------------------------------------------------------- | Extensions you don't want to show on File Manager |-------------------------------------------------------------------------- | */ 'exceptExtensions' => array( 'php', 'htaccess', 'gitignore'), /* |-------------------------------------------------------------------------- | Append tu url. For if you use a custom service to load assets by url. Example here: http://stackoverflow.com/a/36351219/4042595 |-------------------------------------------------------------------------- | */ 'appendUrl' => null, /* |-------------------------------------------------------------------------- | If optimizeImages is set tu true, action to optimize images will be available under contextualMenu. | Images will be also optimized by method upload | False by default |-------------------------------------------------------------------------- | */ 'optimizeImages' => false, /* |-------------------------------------------------------------------------- | Path for pngquant. This is used to auto optimize png files. If set to null, FileManager will not optimize png files. | You must install pngquant in your host. https://pngquant.org | Must have optimizeImages option set to true | Null by default |-------------------------------------------------------------------------- | */ 'pngquantPath' => null, /* |-------------------------------------------------------------------------- | Path for pngquant. This is used to auto optimize jpg files. If set to null, FileManager will not optimize jpg files. | You must install JPEG Archive in your host. https://github.com/danielgtaylor/jpeg-archive | Must have optimizeImages option set to true | Null by default |-------------------------------------------------------------------------- | */ 'jpegRecompressPath' => null, );
您可以看到您的新 FileManager。默认为:admin/filemanager
。
对话框(模态)版本
FileManager 还有一个对话框或模态版本。
更多截图
待办事项
- 更好的文档
谢谢
- Daniel Morales: dmuploader
- SWIS: contextMenu
- Nils Plaschke: Chumper/Zipper
许可证: MIT