Laravel 5 - image verification does not work

I use the Laravel 5 validator to check avatars, my rules look like this:

$validator = Validator::make( Request::all(), [ 'avatar' => 'required|image|max:1000' ] ); 

I am trying to upload files and it always says "no file choosen". If I delete the required rule, it will work, even the max: 1000 rule.

+5
source share
1 answer

make sure the form accepts files,

 Form::open(array('url' => 'foo/bar', 'files' => true)) 

or

 <form action="foo/bar" enctype="multipart/form-data"> 
+22
source

All Articles