Closed bojmaliev closed 1 day ago
This PR updates the contains validation rule to support strings in addition to arrays.
Example:
$request->validate([ 'input' => 'Hello, {name}', ], [ 'input' => 'required|contains:{name}', ]); // Passes
This simplifies string validation by removing the need for custom regex, making it more intuitive and user-friendly.
Docs PR: https://github.com/laravel/docs/pull/10034
I think validation.php should remain the same
validation.php
This introduces a bit of inconsistent behavior where strings allow wildcards and arrays don't. I think I'll table this one for now... easiest way to accomplish this would be closure based rules.
This PR updates the contains validation rule to support strings in addition to arrays.
Example:
This simplifies string validation by removing the need for custom regex, making it more intuitive and user-friendly.
Docs PR: https://github.com/laravel/docs/pull/10034
I think
validation.php
should remain the same