New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

jrumbut/eloquent-memoize

Memoization for Eloquent (Laravel) Models
7,496 8

Larablocks Analysis

jrumbut/eloquent-memoize works with Laravel 5 (latest release v0.1.1, Aug 29, 2018), which reached end of life: no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 5, past end of life
  • No release in the last 12 months (last: Aug 29, 2018)
  • 5 downloads a month (needs 10,000)
  • 8 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Aug 29, 2018.
  • No releases in the last 12 months.
  • First released: Jul 10, 2016.
  • Monthly downloads: 5, up 400% from six months ago.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 26, 2026.

Install
composer require jrumbut/eloquent-memoize
Latest Version:v0.1.1
PHP:>=5.5.0
Laravel:5
License:MIT
Last Updated:Oct 1, 2021
Links: GitHub  ·  Packagist
Maintainer: jrumbut

EloquentMemoize

Latest Version on Packagist Software License Coverage Status Quality Score Total Downloads SensioLabsInsight

Memoization for Eloquent models.

Install

Via Composer

$ composer require jrumbut/eloquent-memoize

Usage

class MyModel extends MemoizingModel
{
    protected static $memoized = ['slow_attribute'];

    //Now only slow the first time it's accessed
    public function getSlowAttribute($value)
    {
        sleep(3);
        return ucwords($value);
    }
}

-or-

class TraitModel extends Model
{
    use Memoizes;
    
    /**
     * Initialize attributes
     *
     * @return void
     */
    public static function boot()
    {
        parent::boot();
        static::setMemoized(['slow']);
    }

    //Now only slow the first time it's accessed
    public function getSlowAttribute($value)
    {
        sleep(3);
        return ucwords($value);
    }
}

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email joshua.rumbut@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

sofa/hookable

Laravel Eloquent hooks system.

2,059,111 64
volosyuk/simple-eloquent

Adaptation of eloquent for retrieving its attributes

119,868 55
gzero/eloquent-tree

Eloquent Tree is a tree model for Laravel Eloquent ORM.

60,021 131
martinbean/laravel-sluggable-trait

A trait you can apply to Eloquent models to have slugs automatically generated o...

49,246 24
isswp101/elasticsearch-eloquent

Elasticsearch functionality like Laravel Eloquent models.

26,254 112

Version History

Version Released PHP Laravel License
v0.1.1 >=5.5.0 5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.* MIT
v0.1.0 >=5.5.0 5.1.* || 5.2.* || 5.3.* MIT
Pre-releases (2)
Version Released PHP Laravel License
v0.0.2-alpha >=5.5.0 5.1.* || 5.2.* || 5.3.* MIT
v0.0.1-alpha >=5.5.0 5.1.* || 5.2.* || 5.3.* MIT