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

[6.x] Rule::RequiredIf should be a remote rule #504

Open
bytestream opened this issue Sep 30, 2020 · 1 comment
Open

[6.x] Rule::RequiredIf should be a remote rule #504

bytestream opened this issue Sep 30, 2020 · 1 comment
Labels

Comments

@bytestream
Copy link
Collaborator

Subject of the issue

Rule::RequiredIf was added in Laravel 6.x and can be used to provide more complex conditions than can be provided by required_if: string syntax.

https://laravel.com/docs/6.x/validation#rule-required-if

Your environment

  • version of this package: 4.3.0
  • version of Laravel: 6.18.41

Steps to reproduce

Validator::make($request->all(), [
    'role_id' => Rule::requiredIf($request->user()->is_admin),
]);

Expected behaviour

It should require an AJAX rule, it's not possible to do this on client side.

Actual behaviour

The rule always passes and is checked client side.

@timinigi
Copy link

Yes I have same issue on the latest v4.8.1, JsValidator acted really inconsistently I had no idea why, but after deep debugging I found out it was for this very same issue. Please any fix would be appreciated.

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

No branches or pull requests

2 participants