ultrasimplified/nova5-image-cropper
Composer 安装命令:
composer require ultrasimplified/nova5-image-cropper
包简介
An advanced image field for Nova with crop and resize.
关键字:
README 文档
README
This package provides an advanced image field for Nova 5 resources allowing you to upload, crop and resize any image. It uses Cropper.js with vue-cropperjs in the frontend and Intervention Image in the backend.
This version has been updated to use the current v3 build of Intervention/Image and has increased compatibility with Laravel Nova version 5.
It has been renamed to Nova5 Image Cropper to make it easier for Nova 5 users to find a tool to meet their image cropping needs.
Requirements
This package requires one of the following libraries:
- GD Library >=2.0 (used by default)
- Imagick PHP extension >=6.5.7
See Intervention requirements for more details.
Installation
Install the package into a Laravel application with Nova using Composer:
composer require ultrasimplified/nova5-image-cropper
If you want to use Imagick as the default image processing library, follow the Intervention documentation for Laravel.
TL;DR: run the following command in the root folder of your site.
php artisan vendor:publish --provider="Intervention\Image\Laravel\ServiceProvider"
This will provide you with a new configuration file (config/image.php) where you can specify your preferred driver.
Usage
ImageCropper extends from File so you can use any methods that File implements. See the documentation here.
<?php namespace App\Nova; // ... use Ultrasimplified\ImageCropper\ImageCropper; class Post extends Resource { // ... public function fields(Request $request) { return [ // ... // Simple image upload ImageCropper::make('photo'), // Show a cropbox with a free ratio ImageCropper::make('photo') ->croppable(), // Show a cropbox with a fixed ratio ImageCropper::make('photo') ->croppable(16/9), // Resize the image to a max width ImageCropper::make('photo') ->resize(1920), // Resize the image to a max height ImageCropper::make('photo') ->resize(null, 1080), // Show a cropbox and resize the image ImageCropper::make('photo') ->croppable() ->resize(400, 300), // Override the image processing driver for this field only ImageCropper::make('photo')->driver('imagick')->croppable(), // Convert the file to a different format ImageCropper::make('photo') ->convert('webp') // Store to AWS S3 AdvancedImage::make('photo') ->disk('s3'), // Specify a custom subdirectory ImageCropper::make('photo') ->disk('s3') ->path('image'), ]; } }
The resize option uses Intervention Image resize() with the upsize and aspect ratio constraints.
Security
If you discover any security related issues, please email robin@ultrasimplified.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
ultrasimplified/nova5-image-cropper 适用场景与选型建议
ultrasimplified/nova5-image-cropper 是一款 基于 Vue 开发的 Composer 扩展包,目前已累计 29.04k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 12 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「image」 「nova」 「resize」 「image resize」 「laravel」 「crop」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ultrasimplified/nova5-image-cropper 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ultrasimplified/nova5-image-cropper 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ultrasimplified/nova5-image-cropper 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova card that shows you your system information.
A Laravel Nova card.
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
A Laravel Nova package for publishable fields
A Laravel Nova package for translatable fields
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
统计信息
- 总下载量: 29.04k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 40
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-26
