public function getMessageAttribute($value) { if ($this->system) { return json_decode($value); } else { return $value; } }