Skip to content

Commit 17d98b9

Browse files
authored
Update LaravelCache.php
1 parent 4ad3c8e commit 17d98b9

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/Utils/LaravelCache.php

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,15 @@ public static function rememberForever(string $cacheKey, callable|Carbon|null $c
6262
return LaravelCache::remember($cacheKey, $cacheTime, $callable, true);
6363
}
6464

65-
public static function get(string $cacheKey): mixed
66-
{
67-
return Cache::get($cacheKey);
68-
}
69-
70-
public static function forget(string $cacheKey): bool
71-
{
72-
return Cache::forget($cacheKey);
73-
}
74-
75-
public static function pull(string $cacheKey): mixed
65+
/**
66+
* 转发调用
67+
*
68+
* @param mixed $method
69+
* @param mixed $args
70+
* @return mixed
71+
*/
72+
public static function __callStatic(mixed $method, mixed $args)
7673
{
77-
return Cache::pull($cacheKey);
74+
return Cache::$method(...$args);
7875
}
7976
}

0 commit comments

Comments
 (0)