SQL Query cache with Eloquent ORM

I am using the eloquent ORM and discovered a new plugin (https://github.com/dwightwatson/rememberable/) for query caching that was amazing.
Do we have this form of plugin here? if not how do one implement query caching because its very important…
ref: https://github.com/dwightwatson/rememberable/issues/59

Slim doens’t include this by default, you can include it in your application though.

I have included it, it will not work because the plugin was built for laravel; check the ref link I sent… so how do we start using it here…?

I have checked the code base of dwightwatson/rememberable and it looks like there are fixed dependencies to the Laravel app() function in Builder.php.

return app('cache')->driver($this->cacheDriver);

Using this library fails with this error message:

Type: Error
Message: Call to undefined function Watson\Rememberable\Query\app()
File: watson\rememberable\src\Query\Builder.php
Line: 182

I think you can only use ´rememberable´ in the context of the Laravel.

YES; but this feature is great and I want to use it, its so easy as we can just pass remember() and it caches query, is there a way we can make it work with slim?

If you can figure it out then yes you can use it!

Slim won’t be adding this feature. Slim does not ship with any database component and that won’t be changing any time soon.

1 Like

yea, not looking for slim to add it, but this community can have someone who already worked on it…

do not understand, issue not resolved yet…

It’s not an issue, slim it’s fantastically slim and this things you have to find a cache library and put it all together yourself. The benefit of that is that you have your program under control. Believe me I had used laravel and when you try slim you never get back to fat frameworks