Reputation: 129
i was editing code from other programmer, and i found this code in model
public function getContentAttribute($value) {
return (json_decode($value, true));
}
And how to get the real value when i call $model->content
without removing the custom model attribute function?
Upvotes: 1
Views: 202
Reputation: 48761
You will need to define another accessor:
public function getContentOriginalAttribute($value) {
return $this->attributes['content'];
}
Then accessing it this way:
$model->content_original
Upvotes: 2