This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hi,
When working for my own plugin i figure out that the function "processValidationRules" will replace the unique validation to 'unique:'.$this->getTable().','.$field.','.$this->getKey().
In this case the excluded column Name is always "id", in this case when your table primary key is not an id, you will got an unknown.
I created my own solution by creating a replication of the trait validation and put it in my plugin. I just added replace
'unique:'.$this->getTable().','.$field.','.$this->getKey()
to
'unique:'.$this->getTable().','.$field.','.$this->getKey(). ','.$this->getKeyName()
In this case it will get the primarykey in the model. and this solution is working. I want this to be added to new build.
Up, I also founded this bug. It will be good if you fix it, so we shouldn't implement our own wheels ;)
1-2 of 2