In db table is there unique index key for two fields:
UNIQUE KEY `coord` (`lat`,`lng`),
In model gii maked this rule:
[['lat', 'lng'], 'unique', 'targetAttribute' => ['lat', 'lng'], 'message' => 'The combination of Latitudine and Longitudine has already been taken.']
But if I try to insert the same data twice, the error is not intercepted by Yii:
Integrity constraint violation β yii\db\IntegrityException
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
How can control this, please ?