2017 © Pedro Peláez
 

library cacheable

Laravel Cacheable

image

valeryq/cacheable

Laravel Cacheable

  • Tuesday, May 10, 2016
  • by valeryq
  • Repository
  • 1 Watchers
  • 6 Stars
  • 91 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Laravel Cacheable

Build Status Scrutinizer Scrutinizer Code Quality Total Downloads Latest Stable Version License, (*1)

Requirements

  • PHP >= 5.5.9
  • Laravel >= 5.1

Installation

Require this package with composer:, (*2)

composer require valeryq/cacheable

Usage

You must implements the Cacheable contract into your class and you can use the CacheableTrait instead realized methods from contract., (*3)

For example (for repositories):, (*4)

<?php namespace App\Repositories\Cacheable;

use App\Models\Product;
use Valeryq\Cacheable\Contracts\Cacheable;
use Valeryq\Cacheable\Traits\CacheableTrait;

class CacheableProductRepository implements Cacheable
{
    use CacheableTrait;

    /**
     * Find product by id
     *
     * @param $id
     *
     * @return Product
     * @throws ModelNotFoundException
     */
    public function find($id)
    {
        return $this->cache()->remember('your_key', 60, function() {
            return Product::findOrFail($id);
        });
    }

    ....
}

License

The Laravel Cacheable is open-sourced software licensed under the MIT license, (*5)

The Versions

10/05 2016

dev-master

9999999-dev

Laravel Cacheable

  Sources   Download

MIT

The Requires

 

by Valery Zakharchenko

laravel cache cacheable

16/11 2015

v1.1.0

1.1.0.0

Laravel Cacheable

  Sources   Download

MIT

The Requires

 

by Valery Zakharchenko

laravel cache cacheable

05/11 2015

v1.0.0

1.0.0.0

Laravel Cacheable

  Sources   Download

MIT

The Requires

 

by Valery Zakharchenko

laravel cache cacheable