smartystudio / gallerycrud
此包已废弃,不再维护。未建议替代包。
使用Backpack CRUD为Laravel提供的画廊管理界面。
1.0.1
2021-07-21 15:27 UTC
Requires
- php: ^7.3|^8.0
- backpack/crud: 4.1.*
- cviebrock/eloquent-sluggable: ^8.0||^7.0||^6.0||4.8
- intervention/image: ^2.2
- league/glide: ^1.7
- league/glide-laravel: ^1.0
- league/glide-symfony: ^1.0
Requires (Dev)
- phpunit/phpunit: ^9.0||^7.0
This package is auto-updated.
Last update: 2024-02-08 16:44:13 UTC
README
Laravel Backpack的admin界面,便于轻松添加、编辑或删除画廊。
它使用Glide并提供辅助方法,在前端blade模板中提供图片服务。
安装
- 在终端
$ composer require smartystudio/gallerycrud -W
- 如果你的Laravel版本没有包自动发现,那么将服务提供者添加到你的config/app.php文件中
Cviebrock\EloquentSluggable\ServiceProvider::class, SmartyStudio\GalleryCrud\GalleryCRUDServiceProvider::class,
- 发布配置文件并运行迁移
$ php artisan vendor:publish --provider="SmartyStudio\GalleryCrud\GalleryCRUDServiceProvider" #publish config, view and migration files $ php artisan migrate #create the gallery table
- 在config/filesystems.php中配置文件存储。
'galleries' => [ 'driver' => 'local', 'root' => storage_path('app/galleries'), ],
- 在config/elfinder.php中配置文件存储。
'roots' => [ [ 'driver' => 'GalleryCrudLocalFileSystem', // driver for accessing file system (REQUIRED) 'path' => '../storage/app/galleries', // path to files - relative to `public` (REQUIRED) 'URL' => '/galleries', // URL to files (REQUIRED) 'accessControl' => 'Barryvdh\Elfinder\Elfinder::checkAccess', 'autoload' => true, 'tmbPath' => '', 'tmbSize' => 150, 'tmbCrop' => false, 'tmbBgColor' => '#000', ], ],
- [可选] 在config/smartystudio/gallerycrud.php中配置Glide图片路径。
'glide_path' => 'image',
- [可选] 在resources/views/vendor/backpack/base/inc/sidebar.blade.php或menu.blade.php中为其添加菜单项
<li class="nav-item"><a class="nav-link" href="{{ url(config('backpack.base.route_prefix', 'admin').'/gallery') }}"><i class="nav-icon la la-picture-o"></i><span>Galleries</span></a></li>
如何使用该包
此包严重依赖于Backpack中的elFinder
文件管理器。
- 首先创建一个画廊
- 选择一些图片或上传新的图片
- 保存画廊并再次编辑它
- 现在您可以编辑所选图片的标题
- 现在可以通过Glide提供辅助方法来加载图片
image_url
可以用于图片来自browse
字段类型的地方,因此它可能已经包括磁盘路径
变更日志
请参阅CHANGELOG获取更多最近变更的信息。
测试
// TODO
贡献
请参阅CONTRIBUTING获取详细信息。
安全
如果您发现任何安全问题,请通过电子邮件联系我们,而不是使用问题跟踪器。
致谢
- Martin Nestorov - Smarty Studio的Web开发者。
- 所有贡献者
许可
SmartyStudio\GalleryCRUD是开源软件,使用MIT许可证。