I have this piece of code in my BaseModel inside the validate method:
foreach(Input::file() as $key => $value)
{
(!empty($value)) ? $this->attributes[$key] = Input::file($key) : $this->attributes[$key] = '';
}
This allows me to integrate file validation with the rest of the input validation. Using the rules required
and mimes:png
it works as it should.
However, for ajax requests I always receive $this->attributes[$key] = ''
.
Is there any catch when uploading files via ajax in Laravel 4?