belongsTo('\App\Models\Account'); } public function payment_gateway() { return $this->belongsTo('\App\Models\PaymentGateway', 'payment_gateway_id', 'id'); } /** * @param $val * @return mixed */ public function getConfigAttribute($value) { return json_decode($value, true); } public function setConfigAttribute($value) { $this->attributes['config'] = json_encode($value); } }