PHPackages                             golchha21/resmushit - 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. golchha21/resmushit

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

golchha21/resmushit
===================

A Laravel package for the popular image optimization web service reSmush.it

1.3.4(6mo ago)822.1k4MITPHPPHP ^7.1|^7.2.5|^7.3|^8.0|^8.1

Since Apr 17Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/golchha21/ReSmushIt)[ Packagist](https://packagist.org/packages/golchha21/resmushit)[ Docs](https://github.com/golchha21/resmushit)[ RSS](/packages/golchha21-resmushit/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (3)Versions (18)Used By (0)

reSmushit for Laravel
=====================

[](#resmushit-for-laravel)

[![Version](https://camo.githubusercontent.com/29e91f60f80b83f6d68e5e22e2a7cad7b0c47729c80113f9b26c061cab23f185/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676f6c6368686132312f7265736d7573686974)](https://packagist.org/packages/golchha21/resmushit)[![Downloads](https://camo.githubusercontent.com/56447f742f999ad1e7f753dee71b3614d3577bc526e2f2b4ffa3f84892cd5f3e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676f6c6368686132312f7265736d7573686974)](https://packagist.org/packages/golchha21/resmushit)[![License](https://camo.githubusercontent.com/7ca049930245778252a89a78261309a1b764cb6453755498b506a50abb44c6cf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f676f6c6368686132312f7265736d7573686974)](https://packagist.org/packages/golchha21/resmushit)

A Laravel package for the popular image optimization web service [reSmush.it](http://resmush.it/)

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

[](#installation)

Install via composer

```
composer require golchha21/resmushit
```

### Publish configuration file

[](#publish-configuration-file)

```
php artisan vendor:publish --provider Golchha21\ReSmushIt\Providers\ServiceProvider --tag=config
```

Example configuration file
--------------------------

[](#example-configuration-file)

```
// config/ReSmushIt.php

return [

    // Keep a copy of the original image
    'original' => true,

    // Image quality (0–100)
    'quality' => 92,

    // Supported mime types
    'mime' => [
        'image/png',
        'image/jpeg',
        'image/gif',
        'image/bmp',
        'image/tiff',
    ],

    // Custom User-Agent for API requests
    'useragent' => 'ReSmushIt v1.3.4',

    // Preserve EXIF metadata
    'exif' => false,

    // Maximum allowed file size in bytes (e.g. 5 MB)
    'max_filesize' => 5242880,
];
```

Usage
-----

[](#usage)

### Option 1: Direct class usage

[](#option-1-direct-class-usage)

```
$file = public_path('images/news1.jpg');
$files = [
    public_path('images/news1.jpg'),
    public_path('images/news2.jpg'),
    public_path('images/news3.jpg'),
    public_path('images/news4.jpg'),
];

$resmushit = new ReSmushIt();
$result  = $resmushit->path($file);
$results = $resmushit->paths($files);
```

### Option 2: Facade usage

[](#option-2-facade-usage)

```
$file = public_path('images/news1.jpg');
$files = [
    public_path('images/news1.jpg'),
    public_path('images/news2.jpg'),
    public_path('images/news3.jpg'),
    public_path('images/news4.jpg'),
];

Optimize::path($file);
Optimize::paths($files);
```

Error Handling
--------------

[](#error-handling)

If the reSmush.it API is unreachable, times out, or returns an invalid response, the optimizer will return a structured error array instead of triggering a fatal error.

### Example

[](#example)

```
$result = Optimize::path($file);

if (isset($result['error'])) {
    // Handle the error (log it, retry, notify user, etc.)
}
```

Return Value
------------

[](#return-value)

Both `path()` and `paths()` always return arrays.

- On success, the response contains optimization details returned by the reSmush.it API.
- On failure, the response contains an `error` key describing the issue, along with additional context when available.

This applies to both single and batch optimization.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Security
--------

[](#security)

For common issues and environment-specific fixes, see [Troubleshoot](TROUBLESHOOT.md). If you discover any security-related issues, please email  instead of using the issue tracker.

Author
------

[](#author)

- [Ulhas Vardhan Golchha](https://github.com/golchha21) -- *Initial work*

See also the list of [contributors](https://github.com/golchha21/reSmushit/graphs/contributors) who participated in this project.

License
-------

[](#license)

reSmushit for Laravel is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance68

Regular maintenance activity

Popularity30

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% 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 ~132 days

Recently: every ~175 days

Total

17

Last Release

189d ago

PHP version history (3 changes)1.0.0PHP ^7.1

1.2.3PHP ^7.1|^7.2.5|^7.3|^8.0

1.2.9PHP ^7.1|^7.2.5|^7.3|^8.0|^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/772400?v=4)[Ulhas Vardhan Golchha](/maintainers/golchha21)[@golchha21](https://github.com/golchha21)

---

Top Contributors

[![golchha21](https://avatars.githubusercontent.com/u/772400?v=4)](https://github.com/golchha21 "golchha21 (6 commits)")[![atastycookie](https://avatars.githubusercontent.com/u/2944373?v=4)](https://github.com/atastycookie "atastycookie (1 commits)")

---

Tags

image-compressionimage-compressorimage-optimisationimage-optimizationimage-optimizerlaravellaravel-packageresmushitphplaravellaravel-packageimage-optimizerimage-optimizationimage-compressionresmush.itImage Optimisationgolchha21image-compressor

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/golchha21-resmushit/health.svg)

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

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.8k2.5k](/packages/unopim-unopim)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21327.3k4](/packages/ecotone-laravel)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

793.9k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

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