Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Ux Cropperjs

Ux Cropperjs Laravel Package

symfony/ux-cropperjs

Symfony UX Cropper.js integrates the Cropper.js image-cropping library with Symfony forms. Add a cropper-enabled form type to let users crop images in the browser and submit crop coordinates alongside uploads, with configurable options and Stimulus-powered behavior.

View on GitHub
Deep Wiki
Context7

Cropper.js integration for Symfony

Frequently asked questions about Ux Cropperjs
Is symfony/ux-cropperjs a Laravel package?
No. It is a Symfony UX package that provides Cropper.js integration through a Symfony bundle, a Twig form theme and type extension, and a Stimulus controller distributed as the npm package @symfony/ux-cropperjs. In a Laravel app, only the JavaScript controller and the Cropper.js dependency are directly usable; the bundle, Twig form theme, and Symfony asset-mapper wiring are inert. You would reimplement upload validation, the upload endpoint, and crop-coordinate persistence in Laravel.
How do I use symfony/ux-cropperjs with Laravel and Vite?
Treat it as a JavaScript asset rather than a Laravel package. Install @symfony/ux-cropperjs and cropperjs via npm, register the Stimulus controller in your existing Stimulus bootstrap, and bind it to a Blade component such as x-image-cropper. Do not require the PHP package or attempt to emulate the Symfony bundle in Laravel. Build your own Laravel controller endpoint for uploads and crop data.
What Laravel versions does symfony/ux-cropperjs support?
It does not target Laravel at all; its PHP constraints are Symfony-oriented. The JavaScript half can run in Laravel 10 or 11 applications that use Vite and Stimulus or Alpine. Laravel version compatibility is a concern for your integration code, not for upstream. Validate the setup in your own application before committing to it.
Do I need to install the PHP package to use the cropper in Laravel?
No. The durable value is the front-end Stimulus controller and the Cropper.js dependency. The PHP package is mainly a bundle class, a form type extension, and a controller used for asset and routing plumbing. For Laravel, the recommended pattern is to ignore the PHP package entirely. Requiring it fights Laravel package discovery and Twig form themes for no practical benefit.
Where should crop coordinates be stored in a Laravel application?
Persist the crop data such as x, y, width, height, rotation, and scale, typically in a JSON column alongside the image path. For trust, validate bounds and optionally re-crop server-side instead of relying only on client-submitted values. Store the original image plus crop metadata so you can reproduce or adjust the crop later.
Is server-side re-cropping required when using Cropper.js in Laravel?
It is not strictly required for UX, but it is recommended for trust. Client-submitted crop coordinates can be tampered with, so validate bounds and optionally re-crop server-side using the original image and submitted coordinates. Decide based on the risk of your upload surface. Many teams store coordinates and re-render only when necessary.
How do I test a Laravel integration with Symfony UX Cropper.js?
Upstream tests cover Symfony wiring and do not de-risk your Laravel integration. Write feature tests for your upload endpoint, validation rules, coordinate persistence, and Blade component rendering. For JavaScript behavior, use browser tests or manual checks. Mock Cropper.js in unit tests where possible.
What are alternatives to symfony/ux-cropperjs for Laravel?
You can use cropperjs directly, choose a maintained Laravel-friendly cropper package, or build your own thin Stimulus or Alpine wrapper. If you only need Cropper.js behavior, depending on it directly reduces Symfony coupling. Evaluate maintenance, asset-pipeline compatibility, and how much wiring you want to own.
Is symfony/ux-cropperjs actively maintained and safe for Laravel production?
Version 3.6.0 shows active maintenance, an MIT license, and a high-profile Symfony organization behind it. Recent changes are tooling refreshes, a README fix, and an asset-mapper bug fix, with no breaking changes reported. For Laravel production, risk is low on the JavaScript side but medium on divergence because you own the wiring, CSP, and security posture. Pin versions and review updates.
Does the v3.6.0 asset-mapper fix affect a Laravel integration?
That fix is scoped to symfony/asset-mapper 8.2+ and Symfony-side consumers, so it is moot in a Laravel Pattern A integration that does not use asset-mapper. If you also maintain Symfony apps, confirm whether it adds a conflict constraint or resolves an incompatibility. For Laravel, it mainly signals how little of the PHP package you would actually consume.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core