PHPackages                             ryuske/redismodel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. ryuske/redismodel

ActiveLibrary[Caching](/categories/caching)

ryuske/redismodel
=================

Use Redis as a primary data store.

v0.5(9y ago)283MITPHPPHP &gt;=5.6

Since Aug 3Pushed 9y ago1 watchersCompare

[ Source](https://github.com/Ryuske/RedisModel)[ Packagist](https://packagist.org/packages/ryuske/redismodel)[ Docs](https://github.com/Ryuske/RedisModel)[ RSS](/packages/ryuske-redismodel/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (8)Versions (2)Used By (0)

RedisModel
==========

[](#redismodel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/cf01cc4e1247716cce946699f1e3aa9e8991410ffc21bc6debaedaa70d2cb0a2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f527975736b652f52656469734d6f64656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Ryuske/RedisModel)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/68c4198c7ea5a836af45b3a03b4ce4ce88605310c5a30c149163abe880000a83/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f527975736b652f52656469734d6f64656c2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Ryuske/RedisModel)[![Total Downloads](https://camo.githubusercontent.com/e23ecdef1d98798dd6fef04d580aaa435b537689a1971d4450b0d75d21af2d9a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f527975736b652f52656469734d6f64656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Ryuske/RedisModel)

A Model accessor that makes using Redis as a primary data store easy.

Install
-------

[](#install)

Via Composer

```
$ composer require Ryuske/RedisModel
```

Usage
-----

[](#usage)

```
/**
 * 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
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Ryuske](https://github.com/Ryuske)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3618d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/89f7ba7d80b2fdf8d5ae47bf71c1cdbc348f660910810aeff5a15f587e0106f6?d=identicon)[Ryuske](/maintainers/Ryuske)

---

Top Contributors

[![Ryuske](https://avatars.githubusercontent.com/u/609591?v=4)](https://github.com/Ryuske "Ryuske (6 commits)")

---

Tags

phpmodelredisryuske

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ryuske-redismodel/health.svg)

```
[![Health](https://phpackages.com/badges/ryuske-redismodel/health.svg)](https://phpackages.com/packages/ryuske-redismodel)
```

###  Alternatives

[awssat/laravel-visits

Laravel Redis visits counter for Eloquent models

974169.8k2](/packages/awssat-laravel-visits)[mjphaynes/php-resque

Redis backed library for creating background jobs and processing them later.

225200.7k2](/packages/mjphaynes-php-resque)[swoft/redis

swoft redis component

12170.3k16](/packages/swoft-redis)[eftec/cacheone

A Cache library with minimum dependency

103.5k4](/packages/eftec-cacheone)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
