Commit 951ccd96 by Junaid Rahman pv

modified unique validation

parent 98e0ece9
...@@ -56,7 +56,7 @@ class District extends \yii\db\ActiveRecord ...@@ -56,7 +56,7 @@ class District extends \yii\db\ActiveRecord
{ {
return [ return [
[['state_id', 'name'], 'required'], [['state_id', 'name'], 'required'],
[['name'], 'unique'], ['name', 'unique', 'targetAttribute' => ['name', 'state_id']],
[['state_id', 'status', 'created_at', 'updated_at'], 'integer'], [['state_id', 'status', 'created_at', 'updated_at'], 'integer'],
[['name', 'slug'], 'string', 'max' => 1024], [['name', 'slug'], 'string', 'max' => 1024],
[['state_id'], 'exist', 'skipOnError' => true, 'targetClass' => State::className(), 'targetAttribute' => ['state_id' => 'id']], [['state_id'], 'exist', 'skipOnError' => true, 'targetClass' => State::className(), 'targetAttribute' => ['state_id' => 'id']],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment