I am using dropzone.js to upload files. Whenever $validation->fails()==true, my response::make breaks with the following error:
"Call to a member function first() on a non-object","file"
Code: public function uploadPhotosAction() { if(Input::file('file')){ $input = Input::all(); $rules = array( 'file' => 'mimes:jpeg,bmp,png|max:5120|min:265', //Only allow files of the type "image" no smaller than 256 kb and no larger than 5 mb ); $validation = Validator::make($input, $rules);
if ($validation->fails())
{
return Response::make($validation->errors->first('file'), 400);
}