File tree Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,14 @@ will output as:
40
40
41
41
` <img src="data:image/png;base64,iVBOR…8f8luO3RPLKe4AAAAAElFTkSuQmCC" width="640" height="640" onload="console.log('loaded')" /> `
42
42
43
+ If you want to override the output, you can publish the view to your own views folder by running:
44
+
45
+ ```
46
+ php artisan vendor:publish --tag="statamic-blurhash"
47
+ ```
48
+
49
+ it will then be found at ` resources/views/vendor/statamic-blurhash/output.blade.php `
50
+
43
51
44
52
### Encoding a BlurHash image
45
53
Original file line number Diff line number Diff line change
1
+ <img src =" {{ $src } }" {!! $params ! !} />
Original file line number Diff line number Diff line change @@ -9,4 +9,11 @@ class ServiceProvider extends AddonServiceProvider
9
9
protected $ tags = [
10
10
Tags \BlurHash::class,
11
11
];
12
+
13
+ public function bootAddon ()
14
+ {
15
+ $ this ->publishes ([
16
+ __DIR__ .'/../resources/views ' => base_path ('resources/views/vendor/statamic-blurhash ' ),
17
+ ], 'statamic-blurhash ' );
18
+ }
12
19
}
Original file line number Diff line number Diff line change @@ -55,8 +55,11 @@ public function decode($encodedString = null)
55
55
public function index ()
56
56
{
57
57
$ image = $ this ->params ->get ('image ' );
58
-
59
- return '<img src=" ' .$ this ->decode ($ this ->encode ($ image )).'" ' .$ this ->renderAttributesFromParams (['image ' ]).' /> ' ;
58
+
59
+ return view ('statamic-blurhash::output ' , [
60
+ 'src ' => $ this ->decode ($ this ->encode ($ image )),
61
+ 'params ' => $ this ->renderAttributesFromParams (['image ' ]),
62
+ ]);
60
63
}
61
64
62
65
/**
You can’t perform that action at this time.
0 commit comments