Level 60
dd($validation->errors());
dump the errors to see why it fails
i just have to validate csv file and store it in public folder and name in db on first step i am using
<input type="file" name="file" class="form-control" accept=".csv" required>
and in controller
$validation=Validator::make($request->all(),[
'file'=>'required|mimes:csv,txt'
]);
if($validation->fails())
{
return back()->with('error',"File Type needs to be of Type");
}
else
{
return back()->with('success',"File Ok");
}
its always returning error block
Please or to participate in this conversation.