diff --git a/src/Rules/MediaRule.php b/src/Rules/MediaRule.php index 2459aa6..86a5c46 100644 --- a/src/Rules/MediaRule.php +++ b/src/Rules/MediaRule.php @@ -39,10 +39,6 @@ public function __construct(...$types) */ public function passes($attribute, $value) { - if (is_string($value) && base64_decode(base64_encode($value)) === $value) { - return true; - } - if (! $value instanceof UploadedFile) { return false; } @@ -84,6 +80,10 @@ protected function getTypeString($value): string ))); } + if (is_string($value) && base64_decode(base64_encode($value)) === $value) { + $type = 'image'; + } + return $type; // either: image, video or audio. }