Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel store array to cache

$value = "foo"; // dynamic string value

if(Cache::has('key')){
  $newValue = Cache::get('key');
  $newValue[] = $value;
  Cache::put('key', $newValue);
}else{
  Cache::put('key', Arr::wrap($value));
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #store #array #cache
ADD COMMENT
Topic
Name
8+8 =