nuhel/filament-croppie 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nuhel/filament-croppie

最新稳定版本:1.1.1

Composer 安装命令:

composer require nuhel/filament-croppie

包简介

README 文档

README

Latest Version on Packagist Total Downloads

Installation

You can install the package via composer:

composer require nuhel/filament-croppie

This field has most of the same functionality of the Filament File Upload field.

screenshot of square croppie

  Croppie::make('image')
      ->getUploadedFileNameForStorageUsing(function (TemporaryUploadedFile $file): string {
          return (string)str("image_path/" . $file->hashName());
      })->enableDownload()
      ->enableOpen()
      ->imageResizeTargetWidth('1000')
      ->imageResizeTargetHeight('800'),

Using imageResizeTargetWidth and imageResizeTargetHeight we can set width and height of the cropper.

Croppie::make('avatar')->avatar()
    ->enableOpen()->enableDownload()
    ->imageResizeTargetWidth('300')
    ->imageResizeTargetHeight('300')
    ->modalSize('xl'),

By default, the size of the resulting image will correspond to imageResizeTargetWidth and imageResizeTargetHeight. Using keepOriginalSize, the size of the resulting image will be at the original scale of the image.

Croppie::make('avatar')->avatar()
    ->enableOpen()->enableDownload()
    ->imageResizeTargetWidth('300')
    ->imageResizeTargetHeight('300')
    ->keepOriginalSize()
    ->modalSize('xl'),

By default, there is no outer container of the cropper. Using withBoundary, we can specify the outer container of the cropper. The specified value is in pixel and will be added to the width and the height of the cropper.

Croppie::make('avatar')->avatar()
    ->enableOpen()->enableDownload()
    ->imageResizeTargetWidth('300')
    ->imageResizeTargetHeight('300')
    ->withBoundary('30')
    ->modalSize('xl'),

We can make croppie circular using avater method. screenshot of big modal

Modal size can be customized if it is needed, using modalSize method.

Croppie::make('background')
    ->enableDownload()
    ->enableOpen()
    ->imageResizeTargetWidth('1000')
    ->imageResizeTargetHeight('400')
    ->modalSize('6xl')
    ->modalHeading("Crop Background Image")

screenshot of big modal

This Plugin is still under development. Some Croppie Feature need's to be implemented, but it provides the main feature of Croppie.

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 2.18k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 18
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 18
  • Watchers: 2
  • Forks: 7
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-20