I have a table like this: (id, name, version, text). (name, version) is unique key, how can i make a rule to validate this.
In Yii2:
public function rules() { return [ [['name'], 'unique', 'targetAttribute' => ['name', 'version']], ]; }