PHPackages                             gepopp/image - 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. gepopp/image

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

gepopp/image
============

:package\_description

v0.1.2(2y ago)113MITPHP

Since Nov 16Pushed 2y ago1 watchersCompare

[ Source](https://github.com/gepopp/laravel-image)[ Packagist](https://packagist.org/packages/gepopp/image)[ Docs](https://github.com/gepopp/laravel-image)[ RSS](/packages/gepopp-image/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

Image
=====

[](#image)

[![Latest Version on Packagist](https://camo.githubusercontent.com/541aa5ffe2a1f166dfc2636b363c45e16b6065cae550a1f750fcc698e8e9005c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6765706f70702f696d6167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gepopp/image)[![Total Downloads](https://camo.githubusercontent.com/cd01028105df8de5b27394bcb707ae918b0903e175f2b32f231bbe911737dd11/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6765706f70702f696d6167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gepopp/image)

This package is ment to reduce the effort when you need an image model with a srcset and multiple image sizes in your laravel project.

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

[](#installation)

Via Composer

```
composer require gepopp/image
```

Usage
-----

[](#usage)

With the package comes a Image model like so:

```
Schema::create( 'images', function ( Blueprint $table ) {
            $table->id();
            $table->string('filename');
            $table->string( 'path' )->nullable();
            $table->string( 'webp_path' )->nullable();
            $table->string( 'url' )->nullable();
            $table->string( 'webp_url' )->nullable();
            $table->string( 'mime' )->nullable();
            $table->unsignedInteger( 'width' )->nullable();
            $table->unsignedInteger( 'height' )->nullable();
            $table->unsignedInteger( 'size' )->nullable();
            $table->json( 'sizes' )->nullable();
            $table->json( 'webp_sizes' )->nullable();
            $table->text( 'srcset' )->nullable();
            $table->text( 'webp_srcset' )->nullable();
            $table->string( 'alt' )->nullable();
            $table->json( 'meta' )->nullable();
            $table->softDeletes();
            $table->timestamps();
        } );

```

It holds all nesscesary information about uploaded images. However you can create a new image with the minimum of a filename. There is a ImageObserver that takes care of inserting all the other data by using the \[[https://image.intervention.io/v2\](Intervention](https://image.intervention.io/v2](Intervention) Image Library). Various images sizes, default sizes accordingly to tailwind breakpoints, are created via jobs dispatched on the queue. You can also customize the sizes and how they are created, please se the config file that can be published vie

```
php artisan vendor:publish image.config
```

Image sizes are defined as an array of arrays, default:

```
'image_sizes' => [
        'create'      => true,
        'create_webp' => true,
        'queue'       => true,
        'sizes'       => [
            [ 150, 150, true ],
            [ 100, 100, true ],
            [ 300, null, false ],
            [ 320, null, false ],
            [ 640, null, false ],
            [ 600, null, false ],
            [ 768, null, false ],
            [ 1024, null, false ],
            [ 1280, null, false ],
            [ 1536, null, false ],
        ],
    ],

```

Where the first value in the size array is the image width, the second one the image height and the bool determines if the new size is created be the [https://image.intervention.io/v2/api/fit](fit) function of intervention image = gets cropped or if its just [https://image.intervention.io/v2/api/resize](resized). If the image gets resizes the height value might be ignored because the image ration will allways be preserved.

Unique Filenames
----------------

[](#unique-filenames)

The package comes with a simple setting how unique filename might be created:

```
 'filenames' => [
        // make the filenames unique to avoid overriding
        'unify'             => true,
        // class used to unify filenames
        'unifiy_with'       => \Gepopp\Image\Filenames\ImageCounterFilenameUnifier::class,
        // place the unifier at end or start of the original filename
        'unify_at'          => 'end',
        'slugify_filenames' => true,
        'slugify_with'      => '_',

    ],

```

There are three unifier classes:

```
\Gepopp\Image\Filenames\ImageCounterFilenameUnifier::class
## it returns an incremented number if the filename allready exists in the images folder on the dist

\Gepopp\Image\Filenames\ImageMircotimeFilenameUnifier::class
## it returns a microtime-timesteamp without .

\Gepopp\Image\Filenames\ImageUlidFilenameUnifier::class
## It returns a Str::ulid unique string

```

This unifier is then appended or prepended to the filename by using the static:

```
Gepopp\Image\Image::getMaybeUnifiedFilename( $filename );

```

method.

Laravel Nova Resource
---------------------

[](#laravel-nova-resource)

The package also includes a laravel nova 4 resource file. It can be published to your project via

```
php artisan vendor:publish image.nova.resource
```

Blade Image Component
---------------------

[](#blade-image-component)

There is also a simple blade component to include images into your blade views it can be publised and customized via

```
php artisan vendor:publish image.views
```

Change log
----------

[](#change-log)

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

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Gerhard Popp](https://github.com/gepopp)
- [All Contributors](../../contributors)

License
-------

[](#license)

MIT. Please see the [license file](license.md) for more information.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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

3

Last Release

913d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/09637fd12838067110b085ccb97a0ba6a2ee57551640a1e671139a8280100e55?d=identicon)[gepopp](/maintainers/gepopp)

---

Top Contributors

[![gepopp](https://avatars.githubusercontent.com/u/2655976?v=4)](https://github.com/gepopp "gepopp (4 commits)")

---

Tags

laravelimageWebpLarave Nova

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gepopp-image/health.svg)

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

###  Alternatives

[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)[joshembling/image-optimizer

Optimize your Filament images before they reach your database.

111145.4k12](/packages/joshembling-image-optimizer)[rolandstarke/laravel-thumbnail

Laravel Thumbnail generator

52140.6k](/packages/rolandstarke-laravel-thumbnail)[danihidayatx/image-optimizer

Optimize your Filament images before they reach your database. Forked from joshembling/image-optimizer for Filament v4 &amp; v5 support.

254.4k](/packages/danihidayatx-image-optimizer)

PHPackages © 2026

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