Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel cache put array

$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 #cache #put #array
ADD COMMENT
Topic
Name
9+9 =