ankitpokhrel / tus-php

🚀 A pure PHP server and client for the tus resumable upload protocol v1.0.0

Home Page:https://tus.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a Laravel Eloquent Cache Backend ?

adriangoris opened this issue · comments

Is your feature request related to a problem? Please describe.
No it is not related to a problem.
I would like to use the standard Laravel Eloquent ORM for the cache system, instead of redis, file, or apcu.

Describe the solution you'd like
I would like to create a key value table that extends the abstract cache class, that uses the laravel ORM.
I understand that redis is more performant however due to technical requirements mysql is the only db available.

Describe alternatives you've considered
It appears that the setCache method on AbstractTus accepts a string of instance of cache. I can create a laravel package that requires tus-php but includes a laravel migration for the key value table and a Cacheable eloquent class.

Additional context
I am not requesting this feature be implemented.
I am simply asking if it has already been done or there is a better way to integrate with the standard laravel eloquent ORM with tus-php.

commented

Hi @adriangoris, the setCache method accepts an instance of Cacheable interface. So, you can implement a cache system/adapter that adheres to the Cacheable interface and use setCache to set it.

thanks for the reply. I created an eloquent cache driver extends AbstractCache