Wednesday, May 10, 2017

Info Seputar Laravel Cache

# Nyimpen
Cache::put($key, $value, $peride)

bisa jg pake add kek gini :
Cache::add($key, $value, $periode-dlm minutes)-->ini nyimpen klu emg blom ada

nyimpen selamanya :
Cache::forever($key, $value);


#Ngambil
$value = Cache::get($key)

atw bisa peke yg ini jg : (ngambil, tp klu blom ada nyimpen ssaui return $value)
Cache::remember($key, $minutes, function() {
    return $value;
});


#Ngapus
Cache::forget($key) -->apus sesuai key
Cache::flush() --> apus semua cache

#Ngecek

Cache::has($key);

No comments:

Post a Comment