11
11
use Hexadog \ThemesManager \Exceptions \ThemeNotFoundException ;
12
12
use Hexadog \ThemesManager \Exceptions \ComposerLoaderException ;
13
13
use Hexadog \ThemesManager \Exceptions \ThemeNotActiveException ;
14
- use Illuminate \Cache \ CacheManager ;
14
+ use Illuminate \Support \ Facades \ Cache ;
15
15
16
16
class ThemesManager
17
17
{
@@ -44,25 +44,17 @@ class ThemesManager
44
44
*/
45
45
private $ view ;
46
46
47
- /**
48
- * Cache Manager.
49
- *
50
- * @var \Illuminate\Cache\CacheManager
51
- */
52
- private $ cache ;
53
-
54
47
/**
55
48
* The constructor.
56
49
*
57
50
* @param \Illuminate\View\Factory $view
58
51
* @param \Illuminate\Contracts\Translation\Translator $lang
59
52
* @param \Illuminate\Cache\CacheManager $lang
60
53
*/
61
- public function __construct (Factory $ view , Translator $ lang, CacheManager $ cache )
54
+ public function __construct (Factory $ view , Translator $ lang )
62
55
{
63
56
$ this ->view = $ view ;
64
57
$ this ->lang = $ lang ;
65
- $ this ->cache = $ cache ;
66
58
67
59
if (Config::get ('themes-manager.cache.enabled ' , false )) {
68
60
$ this ->themes = $ this ->getCache ();
@@ -88,7 +80,7 @@ public function all()
88
80
*/
89
81
public function buildCache (): bool
90
82
{
91
- return $ this -> cache -> put (Config::get ('themes-manager.cache.key ' , 'themes-manager ' ), $ this ->findThemes (), Config::get ('themes-manager.cache.lifetime ' , 86400 ));
83
+ return Cache:: put (Config::get ('themes-manager.cache.key ' , 'themes-manager ' ), $ this ->findThemes (), Config::get ('themes-manager.cache.lifetime ' , 86400 ));
92
84
}
93
85
94
86
/**
@@ -99,7 +91,7 @@ public function buildCache(): bool
99
91
public function clearCache (): bool
100
92
{
101
93
if (Config::get ('themes-manager.cache.enabled ' , false ) === true ) {
102
- return $ this -> cache -> forget (Config::get ('themes-manager.cache.key ' , 'themes-manager ' ));
94
+ return Cache:: forget (Config::get ('themes-manager.cache.key ' , 'themes-manager ' ));
103
95
}
104
96
105
97
return true ;
@@ -417,7 +409,7 @@ protected function findThemes(): Collection
417
409
*/
418
410
protected function getCache (): Collection
419
411
{
420
- return $ this -> cache -> remember (Config::get ('themes-manager.cache.key ' , 'themes-manager ' ), Config::get ('themes-manager.cache.lifetime ' , 86400 ), function () {
412
+ return Cache:: remember (Config::get ('themes-manager.cache.key ' , 'themes-manager ' ), Config::get ('themes-manager.cache.lifetime ' , 86400 ), function () {
421
413
return $ this ->findThemes ();
422
414
});
423
415
}
0 commit comments