3
I’m trying to use the Validator
to validate the upload file type but not sure if the syntax is correct
$data=Input::all();
$file = $data["picture_url"];
$rules = array('picture_url' => 'required|max:10000|mimes:jpg');
$validator = Validator::make($file, $rules);
if ($validator->fails()) {
echo "Arquivo inválido";
}else{
}
because the following mistake is making
Errorexception in Factory.php line 91: Argument 1 passed to Illuminate Validation Factory::make() must be of the type array, Object Given, called in C: Users ssilva Documents wispot-manager vendor Laravel framework src Illuminate Support Facades Facade.php on line 219 and defined
Does anyone know how to solve?
Yeah, it really worked! and I changed the Rules to
$rules = array('picture_url' => 'required|image');
– Silvio Andorinha