1

i am trying to load a cached value by providing a segment of it's key and i can't find out how...i want something like SQL syntax Example here but with laravel caching system:

select * where key like '%{segment of the key }%'

PS: i am using file drive

Omar Ajmi
  • 180
  • 1
  • 13

1 Answers1

1

To date there is no native possibility of Laravel (7.x).

A not immediate option is to implement an event system related to caching (https://laravel.com/docs/7.x/cache#events).

You could save your keys in a table in memory (in MySQL it is very simple. ) through the KeyWritten event.

Then you could use the query you mentioned to search for the key on the Memory table.

Of course the KeyForgotten event will have to delete the keys from the memory table.

robotu
  • 203
  • 2
  • 7