I'm trying to use Validator
to validate the upload file type but I do not know 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 you are giving the following error
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 online 219 and defined
Does anyone know how to solve it?