demo: http://dcat.weiwait.cn (admin:admin)
composer require weiwait/dcat-cropper
php artisan vendor:publish --tag=weiwait.dcat-cropper --force
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)