2017 © Pedro Peláez
 

library redismodel

Use Redis as a primary data store.

image

ryuske/redismodel

Use Redis as a primary data store.

  • Wednesday, August 3, 2016
  • by Ryuske
  • Repository
  • 1 Watchers
  • 1 Stars
  • 75 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

RedisModel

Latest Version on Packagist ![Software License][ico-license] Build Status ![Total Downloads][ico-downloads], (*1)

A Model accessor that makes using Redis as a primary data store easy., (*2)

Install

Via Composer, (*3)

``` bash $ composer require Ryuske/RedisModel, (*4)


## Usage ``` php /** * Available Methods: * get($id, $fields='all') * * searchBy($data, $fields='all'); * searchByWildcard($data, $fields='all'); * * update($id) * save() * * delete($id) * delete() */ class Account extends Ryuske\Redis\Model { /** * These are fields that are searchable. * The order of this list matters! * Add additional indexes to the bottom * * @var array */ protected $indexes = [ 'id', 'email' ]; /** * These are additional, non-searchable indexes. * The order of this list doesn't matter. * * @var array */ protected $fields = [ 'name', 'password' ]; } class MyController { /** * @var Account */ protected $account; public function __construct(Account $account) { $this->account = $account; } public function showAccount($id) { $account = $this->account->get($id); return view('account.show', [ 'account' => $account ]); } }

Change log

Please see CHANGELOG for more information what has changed recently., (*5)

Testing

bash $ composer test, (*6)

Security

If you discover any security related issues, please email kenyon.jh@gmail.com instead of using the issue tracker., (*7)

Credits

License

The MIT License (MIT). Please see License File for more information., (*8)

The Versions