You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose you have applied Universal Custom Thumbnails but need to have changes for specific image field then you can pass array of custom requirements :
135
+
136
+
```sh
137
+
$thumbnails = [
138
+
'storage' => 'customs/embed',
139
+
'width' => '600',
140
+
'height' => '400',
141
+
'quality' => '70',
142
+
'thumbnails' => [
143
+
[
144
+
'thumbnail-name' => 'customSmall',
145
+
'thumbnail-width' => '300',
146
+
'thumbnail-height' => '200',
147
+
'thumbnail-quality' => '50'
148
+
]
149
+
]
150
+
];
151
+
$image->makeThumbnail('image', $thumbnails);
152
+
```
153
+
82
154
## How to use thumbnail ?
83
155
84
156
Just call as following
85
157
86
158
```sh
159
+
// Here the first parameter 'image' is the name of sttribute that is saved in db for image
160
+
87
161
@foreach ($images as $image)
88
-
<img src="{{asset($image->thumbnail('small'))}}"> // For small thumbnail
89
-
<img src="{{asset($image->thumbnail('medium'))}}"> // For medium thumbnail
162
+
<img src="{{asset($image->thumbnail('image','small'))}}"> // For small thumbnail
163
+
<img src="{{asset($image->thumbnail('image','medium'))}}"> // For medium thumbnail
90
164
@endforeach
91
165
```
92
166
93
167
if you are using custom thumbnail configured from config file just call as follows
94
168
95
169
```sh
170
+
// Here the first parameter 'image' is the name of sttribute that is saved in db for image
171
+
// Second parameter is the name of thumbnail that you gave in 'thumbnail-name' in the config file on custom thumbnail field called 'thumbnails'
96
172
@foreach ($images as $image)
97
-
<img src="{{asset($image->thumbnail('test-small'))}}"> // For small thumbnail
98
-
<img src="{{asset($image->thumbnail('test-medium'))}}"> // For medium thumbnail
173
+
<img src="{{asset($image->thumbnail('image','small'))}}"> // For small thumbnail
174
+
<img src="{{asset($image->thumbnail('image','medium'))}}"> // For medium thumbnail
0 commit comments