DemianD / laravel-cache-rethinkdb by Demian

RethinkDB Cache Driver for Laravel 5
22
1
3
Package Data
Maintainer Username: Demian
Package Create Date: 2016-10-31
Package Last Update: 2016-10-31
Language: PHP
License: MIT
Last Refreshed: 2024-11-15 15:16:10
Package Statistics
Total Downloads: 22
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 3
Total Forks: 0
Total Open Issues: 0

laravel-cache-rethinkdb

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