diff --git a/src/CacheKey.php b/src/CacheKey.php index 13ddfa1..e689e1d 100644 --- a/src/CacheKey.php +++ b/src/CacheKey.php @@ -287,7 +287,15 @@ protected function getValuesFromWhere(array $where) : string return implode("_", collect($where["value"])->flatten()->toArray()); } - return (new Arr)->get($where, "value", ""); + $value = (new Arr)->get($where, "value", ""); + + if ($value instanceof \BackedEnum) { + return $value->value; + } elseif ($value instanceof \UnitEnum) { + return $value->name; + } + + return $value; } protected function getValuesFromBindings(array $where, string $values) : string