protected function cacheForgetByKeys($entity = null)
    {
        $keys = $this->keysToForgetCache;

        if (is_array($keys) and array_diff_key($keys, array_keys(array_keys($keys)))) {
            foreach ($keys as $key => $method) {
                cache()->forget($key);
                if (is_subclass_of($entity, ParentModel::class)) {
                    if (method_exists($model = $entity->getModel(), $method)) {
                        $model->$method();
                    }
                }
            }
        }
    }
protected function cacheForgetByKeys($entity = null)
    {
        $keys = $this->keysToForgetCache;

        if (is_array($keys) and array_diff_key($keys, array_keys(array_keys($keys)))) {
            foreach ($keys as $key => $method) {
                cache()->forget($key);
                if (is_subclass_of($entity, ParentModel::class)) {
                    if (method_exists($model = $entity->getModel(), $method)) {
                        $model->$method();
                    }
                }
            }
        }
    }
protected function cacheForgetByKeys ( $ entity = null ) { $ keys = $ this -> keysToForgetCache ; if ( is_array ( $ keys ) and array_diff_key ( $ keys , array_keys ( array_keys ( $ keys ) ) ) ) { foreach ( $ keys as $ key => $ method ) { cache ( ) -> forget ( $ key ) ; if ( is_subclass_of ( $ entity , ParentModel :: class ) ) { if ( method_exists ( $ model = $ entity -> getModel ( ) , $ method ) ) { $ model -> $ method ( ) ; } } } } }
Clearing cache by keys.
Clearing cache by keys .