Join GitHub today
[5.6] Ignore a given model during a unique check. #23524
This PR adds the ability to ignore a given model during a unique validation rule check instead of passing the column's value and name to the ignore() method, we can pass the actual model to the ignore and by default the rule will grab the primary key name and value for the model. Also it adds the ability to select a custom column and the corresponding value will be retrieved from the model.
Let's Consider we have a Company model that we need to update it's name and the company names should be unique, therefore the validation rule will be as follows