PHPackages                             mynulleo/laravel-image-cropper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. mynulleo/laravel-image-cropper

ActiveLibrary[Image &amp; Media](/categories/media)

mynulleo/laravel-image-cropper
==============================

A lightweight and reusable Laravel Blade component for cropping images with custom aspect ratio, rotation, zoom, and base64 output.

v1.1.0(10mo ago)09MITBladePHP ^8.1

Since Jul 10Pushed 10mo agoCompare

[ Source](https://github.com/kazileole/laravel-image-cropper)[ Packagist](https://packagist.org/packages/mynulleo/laravel-image-cropper)[ RSS](/packages/mynulleo-laravel-image-cropper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (12)Used By (0)

📸 Laravel Image Cropper
=======================

[](#-laravel-image-cropper)

A reusable Laravel Blade component for cropping images with custom aspect ratio, rotation, zoom, drag, and base64 output.

---

✅ Requirements
--------------

[](#-requirements)

- PHP &gt;= 8.1
- Laravel 10 or 11
- Bootstrap 5 (included in your layout or via CDN)

---

🔧 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require mynulleo/laravel-image-cropper
```

---

📤 Publish Assets
----------------

[](#-publish-assets)

Run the following command to publish the required assets (CSS &amp; JS):

```
php artisan vendor:publish --tag=image-cropper-assets
```

Assets will be published to:

```
public/vendor/image-cropper/

```

---

🧩 Usage
-------

[](#-usage)

Use the component in your Blade form:

```

    @csrf

    Submit

```

---

⚙ Features
----------

[](#-features)

- Modal-based image cropping
- Fixed or custom aspect ratio (e.g., `816/484`)
- Zoom, rotate, drag, flip, reset
- Output: base64-encoded image
- Preview support
- Responsive modal
- Automatically clears input on crop/cancel
- Built with [cropperjs](https://github.com/fengyuanchen/cropperjs)

---

📂 Asset Folder Structure
------------------------

[](#-asset-folder-structure)

After publishing:

```
public/
└── vendor/
    └── image-cropper/
        ├── cropper.css
        └── cropper.js

```

---

📦 Vite/Webpack Users (optional)
-------------------------------

[](#-vitewebpack-users-optional)

If you use a bundler and want to avoid publishing to `public/`, you can import the assets directly from:

```
resources/assets/cropper.css
resources/assets/cropper.js

```

Then include them in your `app.css` and `app.js` builds.

---

📌 Notes
-------

[](#-notes)

- Requires Bootstrap 5 (you can include from CDN or your compiled CSS)
- The `output-name` field will be the name of the hidden input that stores the base64 value
- You can change modal text/button icons by editing the component view
- Image validation (mime, size, dimension) happens before cropper is shown

---

🧠 Backend Validation Example (optional)
---------------------------------------

[](#-backend-validation-example-optional)

```
$request->validate([
    'cropped_image' => 'required|string', // base64 string
]);
```

---

🙋‍♂️ Support
------------

[](#‍️-support)

For issues, feature requests, or contributions, please open a ticket on [GitHub](https://github.com/mynulleo/laravel-image-cropper).

---

🪪 License
---------

[](#-license)

MIT License
© 2025 [Mynul Islam (mynulleo)](https://github.com/mynulleo)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance54

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

11

Last Release

306d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1cc2c67f41d1b2bc0d0a7f483b73566d4f35f4046230b7a3399395e40e45dbd8?d=identicon)[kazileole](/maintainers/kazileole)

---

Top Contributors

[![nsl-leo](https://avatars.githubusercontent.com/u/53362847?v=4)](https://github.com/nsl-leo "nsl-leo (14 commits)")

### Embed Badge

![Health badge](/badges/mynulleo-laravel-image-cropper/health.svg)

```
[![Health](https://phpackages.com/badges/mynulleo-laravel-image-cropper/health.svg)](https://phpackages.com/packages/mynulleo-laravel-image-cropper)
```

###  Alternatives

[creativeorange/gravatar

A Laravel Gravatar package for retrieving gravatar image URLs or checking the existance of an image.

5467.5M54](/packages/creativeorange-gravatar)[intervention/image-laravel

Laravel Integration of Intervention Image

1496.5M102](/packages/intervention-image-laravel)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[ralphjsmit/laravel-glide

Auto-magically generate responsive images from static image files.

4719.6k5](/packages/ralphjsmit-laravel-glide)[spatie/laravel-og-image

Generate OG images for your Laravel app

305.2k](/packages/spatie-laravel-og-image)[nikkanetiya/laravel-color-palette

Laravel Wrapper for `ksubileau/color-thief-php`. Grabs the dominant color or a representative color palette from an image. Uses PHP and GD or Imagick.

3312.6k](/packages/nikkanetiya-laravel-color-palette)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
