PHPackages                             talleu/php-redis-om - 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. [Database &amp; ORM](/categories/database)
4. /
5. talleu/php-redis-om

ActiveLibrary[Database &amp; ORM](/categories/database)

talleu/php-redis-om
===================

A PHP object mapper library for Redis

v0.5.0(3mo ago)19711.2k↓22.6%14[14 issues](https://github.com/clementtalleu/php-redis-om/issues)[2 PRs](https://github.com/clementtalleu/php-redis-om/pulls)1MITPHPPHP &gt;=8.2CI passing

Since Jun 5Pushed 1mo ago5 watchersCompare

[ Source](https://github.com/clementtalleu/php-redis-om)[ Packagist](https://packagist.org/packages/talleu/php-redis-om)[ RSS](/packages/talleu-php-redis-om/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (9)Versions (40)Used By (1)

[![Build Status](https://github.com/clementtalleu/php-redis-om/actions/workflows/tests.yaml/badge.svg)](https://github.com/clementtalleu/php-redis-om/actions)[![PHPStan](https://camo.githubusercontent.com/695729a68277577171bbc4ff5533a3c7244b4a3161cf940f5c194bf996b8fa1b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4f4b2d627269676874677265656e)](https://camo.githubusercontent.com/695729a68277577171bbc4ff5533a3c7244b4a3161cf940f5c194bf996b8fa1b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4f4b2d627269676874677265656e)[![Packagist Version](https://camo.githubusercontent.com/f612fa8d8ef9c1f84f1496a15b5797d482911484cfb12d5974baa83497956300/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74616c6c65752f7068702d72656469732d6f6d2e737667)](https://packagist.org/packages/talleu/php-redis-om)[![GitHub](https://camo.githubusercontent.com/d8c8923b264d31f407f4c16dda3197fc7d86ba1a3a443b10e06e2b6660c3fb3b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f636c656d656e7474616c6c65752f7068702d72656469732d6f6d2e737667)](https://github.com/averias/phpredis-json)[![codecov.io Code Coverage](https://camo.githubusercontent.com/e859730605b9b33e22196ea39b1245c589106dce7763f0498a0a756e1285dc7a/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f636c656d656e7474616c6c65752f7068702d72656469732d6f6d2e737667)](https://codecov.io/github/clementtalleu/php-redis-om?branch=main)

php-redis-om 🗄️
===============

[](#php-redis-om-️)

A PHP object mapper for [Redis](https://redis.io/).

An Object Mapper for Redis®, designed to providing an intuitive and familiar interface for PHP developers to interact with Redis.

Features 🛠️
-----------

[](#features-️)

- Doctrine-like methods and architecture
- Symfony bundle integration
- Easy integration with existing PHP applications
- High performance and scalability with Redis®
- Support for Redis JSON module
- Automatic schema generation
- Search and query capabilities
- Auto-expiration of your objects
- API Platform support (beta)

Requirements ⚙️
---------------

[](#requirements-️)

- PHP 8.2 or higher
- Redis 4.0 or higher
- Redisearch module (available by default with Redis &gt;8 or in redis-stack distribution) ([installation](https://redis.io/docs/latest/operate/oss_and_stack/install/install-stack/))
- php-redis extension OR Predis library
- Redis JSON module (optional, include in redis-stack)
- Composer

Supported types ✅
-----------------

[](#supported-types-)

- scalar (string, int, float, bool, double)
- timestamp
- json
- null
- DateTimeImmutable
- DateTime
- array and nested arrays
- object and nested objects
- stdClass

Installation 📝
--------------

[](#installation-)

Install the library via Composer:

```
composer require talleu/php-redis-om
```

Depending on your configuration, use phpredis or Predis

Symfony bundle 🎵
----------------

[](#symfony-bundle-)

In a Symfony application, you may need to add this line to config/bundles.php

```
    Talleu\RedisOm\Bundle\TalleuRedisOmBundle::class => ['all' => true],
```

And that's it, your installation is complete ! 🚀

API Platform support 🕷️
-----------------------

[](#api-platform-support-️)

For API Platform users, a basic implementation is provided here: [API Platfom X Redis](docs/api_platform.md)

Basic Usage 🎯
-------------

[](#basic-usage-)

Add the RedisOm attribute to your class to map it to a Redis schema:

```
