@@ -38,10 +38,10 @@ public function __invoke(Request $request, string $options, string $path)
38
38
39
39
if (File::exists ($ cachePath )) {
40
40
if (Cache::has ('image-transform-url: ' .$ cachePath )) {
41
- return response (File::get ($ cachePath ), 200 , [
42
- 'Content-Type ' => File::mimeType ($ cachePath ),
43
- 'X-Cache ' => 'HIT ' ,
44
- ]);
41
+ return response (File::get ($ cachePath ), 200 , [
42
+ 'Content-Type ' => File::mimeType ($ cachePath ),
43
+ 'X-Cache ' => 'HIT ' ,
44
+ ]);
45
45
} else {
46
46
// Cache expired, delete the cache file and continue
47
47
File::delete ($ cachePath );
@@ -101,7 +101,7 @@ public function __invoke(Request $request, string $options, string $path)
101
101
$ cacheDir = dirname ($ cachePath );
102
102
103
103
File::ensureDirectoryExists ($ cacheDir );
104
- File::put ($ cachePath , $ encoded );
104
+ File::put ($ cachePath , $ encoded-> toString () );
105
105
106
106
Cache::put (
107
107
key: 'image-transform-url: ' .$ cachePath ,
@@ -111,7 +111,7 @@ public function __invoke(Request $request, string $options, string $path)
111
111
});
112
112
}
113
113
114
- return response ($ encoded , 200 , [
114
+ return response ($ encoded-> toString () , 200 , [
115
115
'Content-Type ' => $ encoded ->mimetype (),
116
116
...(config ()->boolean ('image-transform-url.cache.enabled ' ) ? [
117
117
'X-Cache ' => 'MISS ' ,
0 commit comments