Skip to content

Commit 903e264

Browse files
authored
Merge pull request #39 from shadoWalker89/patch-2
Allow method chaining
2 parents 0ad2002 + 081beeb commit 903e264

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/HasImageUploads.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ public function imageTag($field = null, $attributes = '')
132132
*
133133
* @param $imageFile
134134
* @param null $field
135+
* @return $this
135136
* @throws InvalidUploadFieldException|\Exception
136137
*/
137138
public function uploadImage($imageFile, $field = null)
@@ -157,18 +158,21 @@ public function uploadImage($imageFile, $field = null)
157158
if ($currentFile != $filePath) {
158159
$this->deleteImage($currentFile);
159160
}
161+
162+
return $this;
160163
}
161164

162165
/**
163166
* Upload a file
164167
*
165168
* @param $file
166169
* @param null $field
170+
* @return $this
167171
* @throws InvalidUploadFieldException
168172
*/
169173
public function uploadFile($file, $field = null)
170174
{
171-
$this->uploadImage($file, $field);
175+
return $this->uploadImage($file, $field);
172176
}
173177

174178
/**

0 commit comments

Comments
 (0)