Skip to content

Commit 178b070

Browse files
committed
Refactor modelCacheRemember method to use value() for resolving input
1 parent 7ae9c4d commit 178b070

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/Concerns/InteractsWithModelCache.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Foxws\ModelCache\Concerns;
66

7-
use Closure;
87
use DateTimeInterface;
98
use Foxws\ModelCache\Facades\ModelCache;
109
use Illuminate\Database\Eloquent\Model;
@@ -77,7 +76,7 @@ public function modelCacheRemember(string $key, mixed $value, DateTimeInterface|
7776
return $this->modelCached($key);
7877
}
7978

80-
$resolved = $value instanceof Closure ? $value() : $value;
79+
$resolved = value($value);
8180

8281
$this->modelCache($key, $resolved, $ttl);
8382

0 commit comments

Comments
 (0)