demian/laravel-cache-rethinkdb

RethinkDB Cache Driver for Laravel 5

v1.0.1 2016-10-31 11:15 UTC

This package is not auto-updated.

Last update: 2024-04-22 12:50:31 UTC


README

RethinkDB Cache Driver for Laravel 5. This package makes it easy to store cached data in RethinkDB.

This way you can also view them in real time.

TODO

  • More tests
  • Make a Query Builder, Eloquent for RethinkDB

Setup

Install RethinkDB.

  • brew install rethinkdb or
  • install Kitematic, search for rethinkdb and install the docker image.

Installation

You can install the package via composer:

composer require demian/laravel-cache-rethinkdb

In your config/app.php

'providers' => [
    ...
    Demian\RethinkDB\RethinkDBServiceProvider::class,
];

In your config/cache.php, create a new store:

'rethinkdb' => [
    'driver' => 'rethinkdb',
    'connection' => [
        'host' => env('RETHINKDB_HOST', '192.168.99.100'),
        'port' => env('RETHINKDB_PORT', '28015'),
        'database' => env('RETHINKDB_DATABASE', 'forge'),
        'table' => 'cache'
    ]
]

Do not forget to create the table

Usage

Cache::store('rethinkdb')->get('key_1');
Cache::store('rethinkdb')->put('key_1', 1);
Cache::store('rethinkdb')->increment('rest_1', 1);
Cache::store('rethinkdb')->decrement('rest_1', 1);

See: https://laravel.com/docs/5.3/cache

See: https://www.rethinkdb.com