I have a form setup to accept multiple files. Validation is done using a form request. Only PDF file types should be accepted. The validator is working but I can't get messages to display. I've tried every combination I can think of in both request messages() and in the language file. The other error messages work fine.
All the inputs work and all the other error messages display. Multiple files will upload. If files contain a non-pdf file, the form redirects without saving the record or files which is expected.
Today something started happening that wasn't happening before. The only thing I've done is a composer update. During the update I noticed quite a lot of updates happening, especially with Symfony.
I overloaded $dontFlash in my form request like this: protected $dontFlash = ['agreement'];. The message went away and I'm now seeing the mimetype error messages as expected. Turns out there was nothing wrong with my validation setup.
I'm not sure exactly what changed in the cores but it's working now. It'd be nice to understand why there was no system error before I ran composer update. Is this perhaps a bug that crept in with a Symfony update and should be reported for @TaylorOtwell in the Laravel tracker?
I believe the problem is related to this Github issue - https://github.com/laravel/framework/issues/14143. I've left a comment with my observations. Still not sure why I was not seeing a Laravel error page before doing composer update.
I believe this issue has to do with recursively calling array_filter and PHP 7.x. The recursive code in Illuminate/Http/RedirectResponse.php predates PHP 7.x. Someone tested in both 5.x and 7.x and confirmed the issue is only appearing in 7.x. More info here.