Skip to content

Commit ef695fb

Browse files
authored
Update Validation of MediaAlly.php Trait
It was giving an error on `$request->file` I just make it to validate whether the given parameter is actually an instance of the upload file or not.
1 parent 3cf628b commit ef695fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/MediaAlly.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Exception;
66
use CloudinaryLabs\CloudinaryLaravel\Model\Media;
7+
use Illuminate\Http\UploadedFile;
78

89
/**
910
* MediaAlly
@@ -29,7 +30,7 @@ public function medially()
2930
*/
3031
public function attachMedia($file, $options = [])
3132
{
32-
if(! file_exists($file)) {
33+
if(!$file instanceof UploadedFile) {
3334
throw new Exception('Please pass in a file that exists');
3435
}
3536

0 commit comments

Comments
 (0)