2017 © Pedro Peláez
 

library eloquent-memoize

Memoization for Eloquent (Laravel) Models

image

jrumbut/eloquent-memoize

Memoization for Eloquent (Laravel) Models

  • Thursday, November 16, 2017
  • by jrumbut
  • Repository
  • 1 Watchers
  • 4 Stars
  • 251 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 40 % Grown

The README.md

EloquentMemoize

Latest Version on Packagist ![Software License][ico-license] ![Coverage Status][ico-scrutinizer] Quality Score ![Total Downloads][ico-downloads] SensioLabsInsight, (*1)

Memoization for Eloquent models., (*2)

Install

Via Composer, (*3)

``` bash $ composer require jrumbut/eloquent-memoize, (*4)


## Usage ``` php 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-, (*5)

``` php class TraitModel extends Model { use Memoizes;, (*6)

/**
 * 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);
}

}, (*7)


## Change log Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. ## Testing ``` bash $ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*8)

Security

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

Credits

License

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

The Versions

16/11 2017

dev-master

9999999-dev https://github.com/jrumbut/eloquent-memoize

Memoization for Eloquent (Laravel) Models

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joshua Rumbut

laravel eloquent memoization

18/07 2016

v0.1.0

0.1.0.0 https://github.com/jrumbut/eloquent-memoize

Memoization for Eloquent (Laravel) Models

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joshua Rumbut

laravel eloquent memoization

11/07 2016

v0.0.2-alpha

0.0.2.0-alpha https://github.com/jrumbut/eloquent-memoize

Memoization for Eloquent (Laravel) Models

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joshua Rumbut

laravel eloquent memoization

11/07 2016

v0.0.1-alpha

0.0.1.0-alpha https://github.com/jrumbut/eloquent-memoize

Memoization for Eloquent (Laravel) Models

  Sources   Download

MIT

The Requires

 

The Development Requires

by Joshua Rumbut

laravel eloquent memoization