PHPackages                             arisharyanto/laracrop - 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. arisharyanto/laracrop

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

arisharyanto/laracrop
=====================

Libraries to create crop image function

1.0.3(8y ago)73641MITJavaScriptPHP ~5.5|~7.0

Since Oct 18Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Aris-haryanto/Laracrop)[ Packagist](https://packagist.org/packages/arisharyanto/laracrop)[ Docs](https://github.com/Aris-haryanto/Laracrop)[ RSS](/packages/arisharyanto-laracrop/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (5)Used By (0)

Laracrop
========

[](#laracrop)

Simple crop image Laravel with jCrop

[![alt crop](https://github.com/Aris-haryanto/Laracrop/raw/master/crop.png)](https://github.com/Aris-haryanto/Laracrop/blob/master/crop.png)

### How to install

[](#how-to-install)

- Run in your terminal:

```
$ cd yourprojectdirectory
$ composer require arisharyanto/laracrop

```

- Add the service providers in config/app.php:

```
Arisharyanto\Laracrop\LaracropServiceProvider::class,

```

- Run this command in the terminal

```
$ php artisan vendor:publish --provider="Arisharyanto\Laracrop\LaracropServiceProvider"

```

- Setup the default config in `config/laracrop.php`

```
# IMPORTANT! the config which is mark with double asterisk (**) you must change this to something unique after install laracrop because security risk

    'route_prefix' => "laracrop",         # **route prefix to ajax url
    'upload_url' => "upload/image",       # **route url to ajax upload url route_prefix/upload_url
    'path_upload' => "public/filetmp",    # **where you put file upload
    'image_url' => "filetmp",             # **please note you must change this with same url from path_upload exclude "public"

    'aspectratio' => "1",                 # 1 to set ratio same with width and height of image or
                                          # you can set with custom ratio like 3/1 or 2/1 whatever you want
                                          # set 0 to free crop

    'minsize' => "[200, 200]",            # Minimum selection size [ width, height ] set 0 to remove min size
    'maxsize' => "[500, 500]",            # Maxium selection size [ width, height ] set 0 to remove max size
    'bgcolor' => "black",                 # Color value for background shading
    'bgopacity' => "0.6"                  # Opacity value for background shading
    'boxwidth' => "600",                  # set image width
    'boxheight' => "600"                  # set image heigth

```

### How to use

[](#how-to-use)

In your blade view

```
# adding laracrop css set true to embed bootstrap css or set empty the parameters to not embeded
@laracropCss(true)

  # you can add custom setting for some croping
  @laracrop(name=desktop | aspectratio=1 | minsize=[300, 300] | bgcolor=black | bgopacity=0.7)

  # or you just write with name parameters like this to set default config
  @laracrop(mobile)

  # NOTE: name is required

# adding laracrop JS set true to embed jQuery or set empty the parameters to not embeded
@laracropJs(true)

```

add `use Arisharyanto\Laracrop\Laracrop` in your Controller

and add this inside your function

```
  # call this function with parameter $request->input('mobile') from view @laracrop(mobile) will return filename to store in database
  $getName = Laracrop::cropImage($request->input('desktop'));

  #call this function at the end of your function to clean temporary file when your uploading image to crop
  Laracrop::cleanCropTemp();

```

### Credits

[](#credits)

-

### License

[](#license)

See the license

### Author

[](#author)

Aris Haryanto visit my website

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~25 days

Total

4

Last Release

3053d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a11a4e3b3577d1f4ddb685cffaa877ac175cce9eae27f48970ce4c6859e94fae?d=identicon)[Aris-haryanto](/maintainers/Aris-haryanto)

---

Top Contributors

[![Aris-haryanto](https://avatars.githubusercontent.com/u/11023724?v=4)](https://github.com/Aris-haryanto "Aris-haryanto (30 commits)")

---

Tags

photocroplaracropphotocrop

### Embed Badge

![Health badge](/badges/arisharyanto-laracrop/health.svg)

```
[![Health](https://phpackages.com/badges/arisharyanto-laracrop/health.svg)](https://phpackages.com/packages/arisharyanto-laracrop)
```

###  Alternatives

[sybio/image-workshop

Powerful PHP class using GD library to work easily with images including layer notion (like Photoshop or GIMP)

860918.1k11](/packages/sybio-image-workshop)[jonom/focuspoint

Smarter automatic image cropping for Silverstripe

108645.6k49](/packages/jonom-focuspoint)[ctessier/nova-advanced-image-field

An advanced image field for Nova with cropping and resizing.

103548.4k1](/packages/ctessier-nova-advanced-image-field)[jbzoo/image

A PHP class that simplifies working with images

171126.9k3](/packages/jbzoo-image)[stefangabos/zebra_image

A single-file, lightweight PHP library designed for efficient image manipulation featuring methods for modifying images and applying filters

141110.4k6](/packages/stefangabos-zebra-image)[dantsu/php-image-editor

PHP library to easily edit image with GD extension.

34152.1k2](/packages/dantsu-php-image-editor)

PHPackages © 2026

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