PHPackages                             josefbehr/filament-spatie-media-library-croppie - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. josefbehr/filament-spatie-media-library-croppie

ActiveLibrary[File &amp; Storage](/categories/file-storage)

josefbehr/filament-spatie-media-library-croppie
===============================================

A filament form field for image upload using spatie media library and croppie.js

1.0.4(3y ago)126.6k—0%6MITBladePHP ^8.0

Since Mar 16Pushed 2y agoCompare

[ Source](https://github.com/josefbehr/filament-spatie-media-library-croppie)[ Packagist](https://packagist.org/packages/josefbehr/filament-spatie-media-library-croppie)[ RSS](/packages/josefbehr-filament-spatie-media-library-croppie/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

Filament Spatie Media Library Croppie Plugin
============================================

[](#filament-spatie-media-library-croppie-plugin)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5e10484aad1afb552e4bac50440d5f52f3cff01d18cea74e664ed7338c534386/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f736566626568722f66696c616d656e742d7370617469652d6d656469612d6c6962726172792d63726f707069652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/josefbehr/filament-spatie-media-library-croppie)[![Total Downloads](https://camo.githubusercontent.com/85bc834b7a795869cc434fba8fd65071cdb43c396cebe656891182d1389821b6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f736566626568722f66696c616d656e742d7370617469652d6d656469612d6c6962726172792d63726f707069652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/josefbehr/filament-spatie-media-library-croppie)

Installation
------------

[](#installation)

You can install the package via composer (no need to install croppie as well as its assets are bundled):

```
composer require josefbehr/filament-spatie-media-library-croppie
```

To use outside filament (e.g. with just the forms package), add the js and css to your vite (or mix) config:

```
@vite([
    'vendor/josefbehr/filament-spatie-media-library-croppie/resources/dist/js/filament-spatie-media-library-croppie.js',
    'vendor/josefbehr/filament-spatie-media-library-croppie/resources/dist/css/filament-spatie-media-library-croppie.css',
    ...
])
```

This field extends and therefore has all the functionality of the [Filament Spatie Media Library Plugin](https://filamentphp.com/docs/2.x/spatie-laravel-media-library-plugin/installation) field.

```
SpatieMediaLibraryCroppie::make('image')
    ->boundaryWidth('100%')
    ->boundaryHeight('600'),
```

Use `boundaryWidth` and `boundaryHeight` to set width and height of the image area in the modal. The values above are the defaults.

```
SpatieMediaLibraryCroppie::make('image')
    ->viewportWidth('400')
    ->viewportHeight('400'),
```

Use `viewportWidth` and `viewportHeight` to set width and height of the cropper itself. Values above are the defaults.

```
SpatieMediaLibraryCroppie::make('image')
    ->showZoomer(),
```

`showZoomer` can be called to show the zoom bar below the image in the modal.

```
SpatieMediaLibraryCroppie::make('avatar')
    ->avatar(),
```

We can make croppie circular using `avater` method.

```
Croppie::make('background')
    ->modalSize('6xl')
    ->modalHeading("Crop Background Image")
```

Modal size can be customized using `modalSize` method. For setting the heading use `modalHeading`.

### Set image quality and format

[](#set-image-quality-and-format)

If your cropped images are very large (see: \[[Foliotek/Croppie#444](https://github.com/Foliotek/Croppie/issues/444)\]), you can use the `imageFormat()` and `imageQuality()` methods to modify the resulting image.

```
SpatieMediaLibraryCroppie::make('image')
    ->imageFormat('jpeg')
    ->imageQuality(0.7);
```

Defaults are:

- `imageQuality(0.9)`
- `imageFormat('png')`

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Acknowldgements
---------------

[](#acknowldgements)

This started as a fork of [nuhel/FilamentCroppie](https://github.com/nuhel/FilamentCroppie), extended and adapted to use spatie/media-library and install croppie via npm.

Changelog
---------

[](#changelog)

v1.0.4

- add imageFormat and imageQuality options/methods

v1.0.3

- re-bundle croppie assets with plugin assets as it does not seem to work otherwise in some cases

v1.0.0

- fork `nuhel/filament-croppie` and rename everything, extend spatie plugin form filed
- remove croppie css and js and re-import them from `node_modules`
- add viewportWidth/Height and boundaryWidth/Height methods

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63% 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 ~12 days

Total

5

Last Release

1105d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4368880?v=4)[Josef Behr](/maintainers/josefbehr)[@josefbehr](https://github.com/josefbehr)

---

Top Contributors

[![Nuhel](https://avatars.githubusercontent.com/u/30118433?v=4)](https://github.com/Nuhel "Nuhel (17 commits)")[![josefbehr](https://avatars.githubusercontent.com/u/4368880?v=4)](https://github.com/josefbehr "josefbehr (10 commits)")

---

Tags

laravelfile-uploadfilamentcroppiespatie-media-library

### Embed Badge

![Health badge](/badges/josefbehr-filament-spatie-media-library-croppie/health.svg)

```
[![Health](https://phpackages.com/badges/josefbehr-filament-spatie-media-library-croppie/health.svg)](https://phpackages.com/packages/josefbehr-filament-spatie-media-library-croppie)
```

###  Alternatives

[mwguerra/filemanager

A full-featured file manager package for Laravel and Filament v5 with dual operating modes, drag-and-drop uploads, S3/MinIO support, and comprehensive security features.

718.5k1](/packages/mwguerra-filemanager)[kingofcode/laravel-uploadable

Laravel Uploadable trait to automatically upload images and files with minimum configuration

286.4k](/packages/kingofcode-laravel-uploadable)[3x1io/filament-browser

File &amp; Folders &amp; Media Browser With Code Editor

491.3k](/packages/3x1io-filament-browser)[fojuth/plupload

A Laravel 4 implementation of Plupload (http://www.plupload.com/).

162.5k](/packages/fojuth-plupload)

PHPackages © 2026

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