I use Cache::set(...)
facade-method for a simple key/value store.
But all posts I visit
seem to talk about Cache::put(...)
method.
What is the difference or advantage of one vs the other?
Advertisement
Answer
set
method is same as put
As you can see from https://github.com/illuminate/cache/blob/master/Repository.php#L227 – set
method delegates all work to put
method.
set
method is added only for compatibility with PSR-16 standard.