PHPackages                             everywell/imagination - 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. [Caching](/categories/caching)
4. /
5. everywell/imagination

ActiveLibrary[Caching](/categories/caching)

everywell/imagination
=====================

A Laravel package that allows to handle images on your models seamlessly

v2.0.6(5y ago)21.2k4[1 issues](https://github.com/EveryWell/imagination/issues)[1 PRs](https://github.com/EveryWell/imagination/pulls)MITPHPPHP ^5.5.9 || ^7.0

Since Aug 22Pushed 5y ago1 watchersCompare

[ Source](https://github.com/EveryWell/imagination)[ Packagist](https://packagist.org/packages/everywell/imagination)[ RSS](/packages/everywell-imagination/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (9)Dependencies (2)Versions (14)Used By (0)

Imagination
===========

[](#imagination)

A Laravel package that allows to handle images on your Eloquent models seamlessly.

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

[](#installation)

To install this package just a few steps are needed

### Composer

[](#composer)

Pull this package in through Composer using the following command inside your terminal:

```
composer require everywell/imagination
```

### Service Provider

[](#service-provider)

Add the package to your application service providers in `config/app.php` file.

```
'providers' => [

    /*
     * Laravel Framework Service Providers...
     */
    Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
    Illuminate\Auth\AuthServiceProvider::class,
    ...

    /**
     * Third Party Service Providers...
     */
    EveryWell\Imagination\ImaginationServiceProvider::class,

],
```

### Config File

[](#config-file)

Publish the package config file to your aplication running the following command inside your terminal:

```
php artisan vendor:publish --provider="EveryWell\Imagination\ImaginationServiceProvider"

```

### Trait and Contract

[](#trait-and-contract)

Include `HasImages` trait and also implement `HasImages` contract inside your model class.

```
use EveryWell\Imagination\Traits\HasImages;
use EveryWell\Imagination\Contracts\HasImages as HasImagesContract;

class News extends Model implements HasImagesContract
{
    use HasImages;
```

### Images attribute

[](#images-attribute)

Add an `images` array attribute to your model containing the fields that should be handled as images.

```
use EveryWell\Imagination\Traits\HasImages;
use EveryWell\Imagination\Contracts\HasImages as HasImagesContract;

class News extends Model implements HasImagesContract
{
    use HasImages;

    protected $fillable = [
        'title',
        'text',
        'banner',
        'image'
    ];

    protected $images = [
        'banner',
        'image' => [
            'discard_original' => true, // Optional: if true, doesn't save the original version of the image
            'dimensions' => [           // Optional: specifies different dimensions than the default config
                [
                    'name' => 'thumb',
                    'width' => 150
                ],
                [
                    'name' => 'small',
                    'width' => 250
                ],
                [
                    'name' => 'regular',
                    'width' => 600
                ]
            ]
        ]
    ];
```

And that's it!

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 74.2% 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 ~125 days

Recently: every ~51 days

Total

11

Last Release

1939d ago

Major Versions

1.0.3 → v2.0.02020-07-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/c8a0170898e6e0fe6df1e3e347b81bd174c9d085e2c6e4c1d666768852643d5b?d=identicon)[EveryWell](/maintainers/EveryWell)

---

Top Contributors

[![EveryWell](https://avatars.githubusercontent.com/u/4259006?v=4)](https://github.com/EveryWell "EveryWell (23 commits)")[![santilorenzo](https://avatars.githubusercontent.com/u/3186441?v=4)](https://github.com/santilorenzo "santilorenzo (8 commits)")

---

Tags

laravelcacheimagesmodels

### Embed Badge

![Health badge](/badges/everywell-imagination/health.svg)

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

###  Alternatives

[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.2M51](/packages/spatie-laravel-responsecache)[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

975163.6k2](/packages/awssat-laravel-visits)[dragon-code/laravel-cache

An improved interface for working with cache

6844.8k10](/packages/dragon-code-laravel-cache)[nexxai/laravel-cfcache

A handful of Cloudflare cache helpers for Laravel

1317.7k](/packages/nexxai-laravel-cfcache)[antennaio/laravel-clyde

Image uploads and manipulation for Laravel, a wrapper around Glide

292.6k](/packages/antennaio-laravel-clyde)[karriere/state

Laravel package for storing current application state in cache/session

1718.5k](/packages/karriere-state)

PHPackages © 2026

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