demian / laravel-cache-rethinkdb
RethinkDB Cache Driver for Laravel 5
v1.0.1
2016-10-31 11:15 UTC
Requires
- danielmewes/php-rql: ^2.3
- illuminate/contracts: ^5.3
- illuminate/database: ^5.3
- illuminate/support: ^5.3
- nesbot/carbon: ^1.21
Requires (Dev)
- mockery/mockery: ^0.9.5
- phpunit/phpunit: 5.*
This package is not auto-updated.
Last update: 2024-11-18 15:49:49 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);