Level 104
Use the mimes/mimetypes rule, e.g.
$this->validate($request, [
'bukti' => ['required', 'mimes:jpeg,bmp,png,gif,svg,pdf'],
]);
Hello,
How to validate an upload file that the type must be a pdf file or an image file ?
ref: https://laravel.com/docs/8.x/validation
JadwalController.php
$this->validate($request, [
'bukti' => 'required|image'
]);
I don't know how to validate the pdf file.
Use the mimes/mimetypes rule, e.g.
$this->validate($request, [
'bukti' => ['required', 'mimes:jpeg,bmp,png,gif,svg,pdf'],
]);
Please or to participate in this conversation.