weiwait / dcat-cropper
Dcat-admin 表单单图裁剪
Installs: 927
Dependents: 0
Suggesters: 0
Security: 0
Stars: 27
Watchers: 2
Forks: 4
Open Issues: 1
Language:JavaScript
Requires
- php: >=7.1.0
- dcat/laravel-admin: ~2.0
README
演示地址
demo: http://dcat.weiwait.cn (admin:admin)
通过 composer 安装扩展
composer require weiwait/dcat-cropper
发布静态资源
php artisan vendor:publish --tag=weiwait.dcat-cropper --force
更新 dcat-admin ide-helper
php artisan admin:ide-helper
$form->cropper('column', 'label') ->jpeg(0.5) // 0 ~ 1 ->useBase64() // 采用base64编码图片统一提交 ->ratio(16/9) // 快捷裁剪选项配置(裁剪比率) ->resolution(1920, 1080) ->ratio(1) ->resolution(100) // 等比 ->ratio(['1:1' => 1, '16:9' => 16/9, '自定义' => null]) // 多预设 ->resolution(['1:1' => [300, 300], '16:9' => [1920, 1080]]) ->options([ // https://github.com/fengyuanchen/cropperjs // 裁剪选项 'cropper' => [ 'aspectRatio' = 16/9, 'background' => false, ] ]) $form->multipleCropper('column', 'label') ->limit(5) // 默认为框架默认值10 ->ratio(16/9) // 快捷裁剪选项配置(裁剪比率) ->resolution(1920, 1080) ->ratio(1) ->resolution(100) // 等比 ->ratio(['1:1' => 1, '16:9' => 16/9, '自定义' => null]) // 多预设 ->resolution(['1:1' => [300, 300], '16:9' => [1920, 1080]]) ->options([ // https://github.com/fengyuanchen/cropperjs // 裁剪选项 'cropper' => [ 'aspectRatio' = 16/9, 'background' => false, ] ]) ->accept('png') ->compress() // intervention/image 功能(dcat)