- What is r64/nova-image-cropper and what does it do?
- r64/nova-image-cropper is a Laravel Nova field that lets editors crop images directly inside the Nova admin panel before saving. It wraps Cropper.js in a Vue component and persists the cropped result through Nova's standard file-upload path. It is intended for avatars, banners, thumbnails, and similar admin-managed image assets, not for building a full media pipeline.
- How do I install r64/nova-image-cropper in Laravel Nova?
- Install it with Composer using composer require r64/nova-image-cropper, then add the field to the relevant Nova resource. You must already have a licensed Laravel Nova installation, since the package is a Nova field and cannot run without it. After installation, configure the field options such as aspect ratio, width, height, and quality in your resource definition.
- Which Laravel Nova and PHP versions does r64/nova-image-cropper support?
- Support depends on the package release, so verify the declared Nova major and PHP version against the installed package's composer.json rather than assuming from the README. Nova majors have historically changed field APIs and asset conventions, so an unsupported Nova upgrade is a likely source of breakage. Pin a compatible release and include a CI check that instantiates the field so upgrades fail loudly.
- How do I configure aspect ratio, width, height, and quality for the crop field?
- The field exposes simple configuration for crop dimensions and quality, which you set when adding it to a Nova resource. Use the aspect ratio option to constrain the editor's crop area and width and height to define the saved output dimensions. Centralize these values as a durable contract so resources and CSS read from one source instead of duplicating crop settings.
- Does cropping run client-side or server-side?
- Cropping happens client-side in the browser using Cropper.js inside the Nova Vue component. The server does not run GD or Imagick for the crop itself, and everything after the save button is ordinary Nova file handling. This keeps the package in the admin presentation tier and avoids adding a new runtime service, queue, or worker.
- Does r64/nova-image-cropper work with S3 or custom storage disks?
- The package persists through Nova's standard file-upload path, so it works with the storage disk your Nova field is configured to use. With S3 or other remote disks, verify visibility and access settings because disk visibility drift can produce 403s that are easily misattributed to the cropper. Health-check the chosen disk and upload-size limits before relying on the field in production.
- Does r64/nova-image-cropper overwrite the original image on re-crop?
- Depending on the installed version, the field may replace the original upload in place. If it does, an editor re-cropping a hero image can permanently destroy the source asset. Decide explicitly whether to retain originals in a separate column and hide the source field on update, and write that retention policy down rather than defaulting.
- Can I use r64/nova-image-cropper outside Laravel Nova or for customer-facing uploads?
- No, the package is a Nova-only field and is not usable outside the Nova admin panel. Stripping the Nova layer leaves a thin coordinate-math wrapper around a commodity JavaScript cropper rather than a reusable image-processing library. For customer-facing media tooling, responsive derivatives, or CDN delivery, evaluate intervention/image, spatie/image, Cloudinary, or imgix instead.
- How do I test that the crop actually saved and is not a silent no-op?
- Add a hard dimension assertion to your acceptance test and perform a manual round-trip on a throwaway Nova resource before touching real data. The main failure mode is a UI that looks successful while the stored image is unchanged or uncropped, which can reach production undetected by CI. Treat the dimension assertion as a release gate, not an optional check.
- What alternatives should I consider for image derivatives and CDN delivery?
- This package only handles interactive cropping in Nova, so use intervention/image or spatie/image when you need server-side derivative generation. For hosted transformation and delivery, consider Cloudinary or imgix. The decision is binary: if the requirement stays inside the Nova admin surface, this field fits cleanly, but customer-facing media tooling is out of scope.