public function behaviors() { return [['class' => \voskobovich\behaviors\ManyToManyBehavior::className(), 'relations' => ['author_list' => ['authors', 'get' => function ($value) { return JSON::encode($value); }, 'set' => function ($value) { return JSON::decode($value); }], 'review_list' => ['reviews', 'get' => function ($value) { return JSON::encode($value); }, 'set' => function ($value) { return JSON::decode($value); }]]]]; }
/** * Get customer Bank Account form attribute col with JSON Format */ public function getCustomerBankAccount() { $attributeCustomer = JSON::decode($this->attribute1); return isset($attributeCustomer['bank_account']) ? $attributeCustomer['bank_account'] : ''; }