File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 33namespace Plusemon \Uploader ;
44
55use Illuminate \Http \UploadedFile ;
6+ use Intervention \Image \Facades \Image ;
67
78/**
89 * Name : Easy File Upload and View Helpers
@@ -238,4 +239,19 @@ public function deleteWith($column): bool
238239 {
239240 return $ this ->deleteWithFile ($ column );
240241 }
242+
243+ /**
244+ * Resizes current image based on given width and/or height. To contraint the resize command, pass an optional Closure callback as third parameter.
245+ *
246+ * @param int $width
247+ * @param int $height
248+ * @param \Closure $callback
249+ * @return \Plusemon\Uploader\HasUploader
250+ */
251+
252+ public function resize ($ width = null , $ height = null , $ callback = null )
253+ {
254+ Image::make ($ this ->uploaded_files [0 ])->resize ($ width , $ height , $ callback )->save ();
255+ return $ this ;
256+ }
241257}
You can’t perform that action at this time.
0 commit comments