Skip to content

Commit e621376

Browse files
committed
More changes for Jigsaw
1 parent 925f542 commit e621376

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "torchlight/laravel",
2+
"name": "torchlight/torchlight-laravel",
33
"description": "A Laravel Client for Torchlight, the syntax highlighting API.",
44
"type": "library",
55
"license": "MIT",

src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ protected function setCacheFromBlocks(Collection $blocks, Collection $ids)
151151
}
152152

153153
if (count($value)) {
154-
Torchlight::cache()->put($this->cacheKey($block), $value, now()->addDays(7));
154+
Torchlight::cache()->put($this->cacheKey($block), $value, $seconds = 7 * 24 * 60 * 60);
155155
}
156156
});
157157
}

src/Manager.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Torchlight;
77

88
use Illuminate\Contracts\Cache\Repository;
9+
use Illuminate\Contracts\Container\Container;
910
use Illuminate\Support\Str;
1011
use Illuminate\Support\Traits\Macroable;
1112
use Illuminate\Support\Facades\Cache;
@@ -24,6 +25,19 @@ class Manager
2425
*/
2526
protected $cache;
2627

28+
/**
29+
* @var Container
30+
*/
31+
protected $app;
32+
33+
/**
34+
* @param Container $app
35+
*/
36+
public function __construct(Container $app)
37+
{
38+
$this->app = $app;
39+
}
40+
2741
/**
2842
* @param $blocks
2943
* @return mixed
@@ -38,7 +52,7 @@ public function highlight($blocks)
3852
*/
3953
public function client()
4054
{
41-
return app(Client::class);
55+
return $this->app->make(Client::class);
4256
}
4357

4458
/**

0 commit comments

Comments
 (0)