Coder Social home page Coder Social logo

bsormagec / laravel-cacheable Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rinvex/laravel-cacheable

0.0 2.0 0.0 103 KB

Rinvex Cacheable is a granular, intuitive, and fluent caching system for eloquent models. Simple, but yet powerful, plug-n-play with no hassle.

License: MIT License

PHP 100.00%

laravel-cacheable's Introduction

Sormagec MongoDB Cacheable

Sormagec MongoDB Cacheable is a granular, intuitive, and fluent caching system for eloquent models. Simple, but yet powerful, plug-n-play with no hassle.

What this package do -technically- caching eloquent query passing through the get method, whatever it is and it's smart enough to indicated any conditions, limit, offset, wheres, orders, groups, ..etc and take that criteria into account when caching and checking for cached version. Also by default any create, update, or delete event will flush all cache for that specific model. It uses default Laravel caching system, and utilizes whatever cache driver you are using. Awesome, right?

Installation & Usage

  1. Install the package via composer:

    composer require sormagec/laravel-cacheable
  2. Use the \Sormagec\Cacheable\CacheableEloquent in your desired model, and you're done!

  3. Seriously, that's it!

Check the CacheableEloquent source code for more awesome stuff if you need advanced control.

Optional Features

You can optionally override model caching behaviour per model as follows:

    /**
     * Indicate if the model cache clear is enabled.
     *
     * @var bool
     */
    protected $cacheClearEnabled = true;

    /**
     * The model cache driver.
     *
     * @var string
     */
    protected $cacheDriver = 'memcached';

    /**
     * The model cache lifetime.
     *
     * @var int
     */
    protected $cacheLifetime = -1;

License

This software is released under The MIT License (MIT).

(c) 2016-2019 Rinvex LLC, Some rights reserved.

laravel-cacheable's People

Contributors

bsormagec avatar omranic avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.