riste/repository

There is no license information available for the latest version (dev-main) of this package.

Allow you to easily cache laravel models and retrieve from laravel's cache by extending AbstractRepository

Maintainers

Package info

github.com/DimitrievskiRiste/repository

pkg:composer/riste/repository

Statistics

Installs: 21

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2025-08-14 15:17 UTC

This package is auto-updated.

Last update: 2026-04-14 16:38:02 UTC


README

INSTALLATION: composer require riste/repository:dev-main

Caching models, example:

class UserRepository extends AbstractRepository { private string $key = "_users"; public function getKey():string { return $this->key; } public function setKey(string $key):void { $this->$key = $key; } }

Finally, if i want to save/update my current user eloquent model i will call:

$userRepo = new UserRepository(); $userModel = User::find(1); $userRepo->addOrUpdate($userModel, 1); // where second parameter is TTL cache in hours

// If i need to search trough cache i will call findMany method $userRepo->findMany(["name" => "Riste"]); // Will look through cache where column is name and value Riste in case insensitive and will return array items of eloquent models that matches name Riste.