Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Array to string conversion error exception #48219

Merged
merged 3 commits into from
Aug 28, 2023
Merged

[10.x] Array to string conversion error exception #48219

merged 3 commits into from
Aug 28, 2023

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