Support the ongoing development of Laravel.io →
Requests Input Validation

Is this considered a bug in Laravel?

Make a validator and require the field to be a string. It correctly fails on integers and booleans, but POST the field as an empty array (json) and it will pass, then later on it crashes in my app

ErrorException in helpers.php line 740: preg_replace(): Parameter mismatch, pattern is a string while replacement is an array

Last updated 3 years ago.
0

I am encountering this same issue. Did you by chance bring this up in a Github issue or pull request?

0

Sign in to participate in this thread!

PHPverse

Your banner here too?

yttkart yttkart Joined 24 Feb 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.