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

Array to string conversion ErrorException #48187

Closed
yooslim opened this issue Aug 25, 2023 · 1 comment · Fixed by #48219
Closed

Array to string conversion ErrorException #48187

yooslim opened this issue Aug 25, 2023 · 1 comment · Fixed by #48219

Comments

@yooslim
Copy link

yooslim commented Aug 25, 2023

Laravel Version

10.4.1

PHP Version

8.1.2

Database Driver & Version

No response

Description

When using "RequiredIf" validation rule that is dependant on another boolean field, if the boolean field gets a non empty array as input, an ErrorException is thrown when trying to get the displayable value of the boolean field.

Steps To Reproduce

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

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants