Yii2 Behavior for encode and decode json stored attributes
composer require kfreiman/yii2-json-attribute-behavior "dev-master"
public function behaviors()
{
return [
'jsonAttributes' => [
'class' => JsonAttributeBehavior::className(),
'attributes' => [
'attrJson' => 'attr'
],
],
];
}