belongsTo(\App\Models\Account::class); } /** * Parent payment gateway * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function payment_gateway() { return $this->belongsTo(\App\Models\PaymentGateway::class, 'payment_gateway_id', 'id'); } /** * @param $value * * @return mixed */ public function getConfigAttribute($value) { return json_decode($value, true); } public function setConfigAttribute($value) { $this->attributes['config'] = json_encode($value); } }