Two model's fields validation at one method

How to validate two model’s two different fields with one custom validation as if any of the field’s value is found then then validation wil be true

You’ll need to:

  • build a custom validation method
  • inspect the data array for the current field and the other model.
  • you’ll need to walk your association or use TableRegistry::get() to query the other model.

Look up custom validation methods in the cake book for more details.

Thanks for your reply I will try in that way