are you actually hitting this validator?
Jun 24, 2022
12
Level 11
PDF Passes Image Validation
I'm uploading multiple files through Livewire and am validating in the updated() method for real-time validation. For some reason, when I select a PDF file it passes validation and I get the "This driver does not support creating temporary URLs" validation error, which tells me the PDF is passing validation.
I've tried 2 different methods of validation and both are allowing the PDF to pass; am I doing something wrong?
$public $photos = [];
public function updated()
{
$this->validate([
'photos.*' => 'mimes:jpg,jpeg,gif,png',
]);
}
$public $photos = [];
public function updated()
{
$validator = Validator::make(
['photos.*' => $this->photos],
['photos.*' => 'mimes:jpg,jpeg,gif,png'],
);
if ($validator->fails()) {
$this->reset('photos');
$this->setErrorBag($validator->getMessageBag());
}
}
Please or to participate in this conversation.