Skip to content

Commit

Permalink
Merge pull request #39 from shadoWalker89/patch-2
Browse files Browse the repository at this point in the history
Allow method chaining
  • Loading branch information
saqueib committed Oct 1, 2019
2 parents 0ad2002 + 081beeb commit 903e264
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/HasImageUploads.php
Expand Up @@ -132,6 +132,7 @@ public function imageTag($field = null, $attributes = '')
*
* @param $imageFile
* @param null $field
* @return $this
* @throws InvalidUploadFieldException|\Exception
*/
public function uploadImage($imageFile, $field = null)
Expand All @@ -157,18 +158,21 @@ public function uploadImage($imageFile, $field = null)
if ($currentFile != $filePath) {
$this->deleteImage($currentFile);
}

return $this;
}

/**
* Upload a file
*
* @param $file
* @param null $field
* @return $this
* @throws InvalidUploadFieldException
*/
public function uploadFile($file, $field = null)
{
$this->uploadImage($file, $field);
return $this->uploadImage($file, $field);
}

/**
Expand Down

0 comments on commit 903e264

Please sign in to comment.