Skip to content

Conversation

hans-thomas
Copy link
Contributor

Hi, I fixed #48187 issue. The issue was to find the related translation line for a boolean validation rule while its value is an array.

Before

$validator = \Illuminate\Support\Facades\Validator::make([
    'is_customer' => ['test'],
    'fullname' => null
], [
    'is_customer' => 'required|boolean',
    'fullname' => 'required_if:is_customer,true'
]);
  
$validator->fails(); // ErrorException

After

$validator = \Illuminate\Support\Facades\Validator::make([
    'is_customer' => ['test'],
    'fullname' => null
], [
    'is_customer' => 'required|boolean',
    'fullname' => 'required_if:is_customer,true'
]);
  
$validator->fails(); // Return true

@hans-thomas hans-thomas marked this pull request as ready for review August 28, 2023 10:24
@taylorotwell taylorotwell merged commit a76d8b2 into laravel:10.x Aug 28, 2023
@hans-thomas hans-thomas deleted the array-to-string-conversion-error-exception branch August 28, 2023 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Array to string conversion ErrorException
2 participants