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

[8.x] Fix formatWheres in DatabaseRule #36441

Merged
merged 4 commits into from
Mar 3, 2021
Merged

[8.x] Fix formatWheres in DatabaseRule #36441

merged 4 commits into from
Mar 3, 2021

Conversation

lloricode
Copy link
Contributor

When we try this, all validation will failed

// controller level

$this->validate($request, [
    'some_field' => Rule::exists(ModelClass::class)->where('extra->field', true),
]);

Checking return of DatabaseRule formatWheres will return

"extra->field,"1""

Now the PR fixes return is

"extra->field,true"

Thank you

@taylorotwell taylorotwell merged commit e3f48f7 into laravel:8.x Mar 3, 2021
@lloricode lloricode deleted the bugfix/database-rules-formatWheres branch March 3, 2021 14:17
taylorotwell added a commit that referenced this pull request Mar 3, 2021
taylorotwell added a commit that referenced this pull request Mar 3, 2021
taylorotwell added a commit that referenced this pull request Mar 3, 2021
taylorotwell added a commit that referenced this pull request Mar 3, 2021
taylorotwell added a commit that referenced this pull request Mar 4, 2021
taylorotwell added a commit that referenced this pull request Mar 4, 2021
@taylorotwell
Copy link
Member

Had to revert this. Breaking people's applications.

@driesvints
Copy link
Member

@lloricode fyi: #36459

@lloricode
Copy link
Contributor Author

@lloricode fyi: #36459

Thank you for informing us

@niefufeng
Copy link

Should be consistent with builder query

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.

4 participants