2017 © Pedro Pelรกez
 

library counter-cache

Counter caching for Laravel

image

nodes/counter-cache

Counter caching for Laravel

  • Wednesday, August 30, 2017
  • by nodes
  • Repository
  • 4 Watchers
  • 12 Stars
  • 4,606 Installations
  • PHP
  • 1 Dependents
  • 1 Suggesters
  • 1 Forks
  • 3 Open issues
  • 12 Versions
  • 12 % Grown

The README.md

Counter Cache

โš ๏ธThis package is deprecatedโš ๏ธ, (*1)

Brings the ruby concept of "counter caching" to Laravel., (*2)

Total downloads Monthly downloads Latest release Open issues License Star repository on GitHub Watch repository on GitHub Fork repository on GitHub StyleCI, (*3)

๐Ÿ“ Introduction

One thing we at Nodes have been missing in Laravel is the concept of "counter caching"., (*4)

Laravel comes "out of the box" with the increment/decrement methods on it's Eloquent models. But you'll need to manually execute these methods everytime, you've saved/delete stuff with your model., (*5)

Since the increment/decrement methods always +1/-1, you can't 100% rely on these as cached value. What if you forgot to execute the decrement method when you deleted a row. Or what if someone deleted a row directly from the database, then your count would be "out of sync"., (*6)

Therefore we've created this package which brings "counter caching" to Laravel., (*7)

The difference between this package and Laravel's increment/decrement is that our package actually generates and fires a SQL count statement, that counts the entries and updates the desired column with the result., (*8)

This way you're always 100% sure that the value in your "counter cache" column is correct., (*9)

๐Ÿ“ฆ Installation

To install this package you will need:, (*10)

  • Laravel 5.1+
  • PHP 5.5.9+

You must then modify your composer.json file and run composer update to include the latest version of the package in your project., (*11)

"require": {
    "nodes/counter-cache": "^1.0"
}

Or you can run the composer require command from your terminal., (*12)

composer require nodes/counter-cache:^1.0

โš™ Usage

Please refer to the Wiki documentation for more information., (*13)

๐Ÿ† Credits

This package is developed and maintained by the PHP team at Nodes Agency, (*14)

Follow Nodes PHP on Twitter Tweet Nodes PHP, (*15)

๐Ÿ“„ License

This package is open-sourced software licensed under the MIT license, (*16)

The Versions

30/08 2017

dev-master

9999999-dev http://nodesagency.com

Counter caching for Laravel

  Sources   Download

MIT

The Requires

 

database laravel model counter cache nodes counter-cache

30/08 2017

2.0.1

2.0.1.0 http://nodesagency.com

Counter caching for Laravel

  Sources   Download

MIT

The Requires

 

database laravel model counter cache nodes counter-cache

16/02 2017

2.0.0

2.0.0.0 http://nodesagency.com

Counter caching for Laravel

  Sources   Download

MIT

The Requires

 

database laravel model counter cache nodes counter-cache

16/02 2017

1.0.3

1.0.3.0 http://nodesagency.com

Counter caching for Laravel

  Sources   Download

MIT

The Requires

 

database laravel model counter cache nodes counter-cache

08/09 2016

1.0.2

1.0.2.0 http://nodesagency.com

Counter caching for Laravel

  Sources   Download

MIT

The Requires

 

database laravel model counter cache nodes counter-cache

28/07 2016

dev-develop

dev-develop http://nodesagency.com

Counter caching for Laravel

  Sources   Download

MIT

The Requires

 

database laravel model counter cache nodes counter-cache

09/06 2016

1.0.1

1.0.1.0 http://nodesagency.com

Counter caching for Laravel

  Sources   Download

MIT

The Requires

 

database laravel model counter cache nodes counter-cache

30/05 2016

1.0.0

1.0.0.0 http://nodesagency.com

Counter caching for Laravel

  Sources   Download

MIT

The Requires

 

database laravel model counter cache nodes counter-cache

11/01 2016

0.1.3

0.1.3.0 http://nodesagency.com

Counter caching for Laravel

  Sources   Download

MIT

The Requires

 

database laravel model counter cache nodes counter-cache

08/01 2016

0.1.2

0.1.2.0 http://nodesagency.com

Counter caching for Laravel

  Sources   Download

MIT

The Requires

 

database laravel model counter cache nodes counter-cache

07/01 2016

0.1.1

0.1.1.0 http://nodesagency.com

Counter caching for Laravel

  Sources   Download

MIT

The Requires

 

database laravel model counter cache nodes counter-cache

06/12 2015

0.1.0

0.1.0.0 http://nodesagency.com

Counter caching for Laravel

  Sources   Download

MIT

The Requires

 

database laravel model counter cache nodes counter-cache