cache delete

This commit is contained in:
CHIEFSOFT\ameye
2024-09-13 05:59:55 -04:00
parent 9750224b01
commit 0cf684ba2c
2 changed files with 26 additions and 1 deletions
@@ -112,6 +112,16 @@ abstract class BaseController extends Controller
}
return $data;
}
public function deleteCache($cacheKey){
$data = [];
$cacheKey = $this->cache_tag."-".$cacheKey;
if (cache($cacheKey)) {
// echo 'Getting Data From Cache!<br>';
$data = unserialize(cache()->delete($cacheKey));
}
return $data;
}
private function data_stringify($data) {
switch (gettype($data)) {
case 'string' : return '\''.addcslashes($data, "'\\").'\'';