content = [$oldTitle, $newTitle]; $post->time = time(); $post->discussion_id = $discussionId; $post->user_id = $userId; $post->type = 'discussionRenamed'; return $post; } /** * Unserialize the content attribute. * * @param string $value * @return string */ public function getContentAttribute($value) { return json_decode($value); } /** * Serialize the content attribute. * * @param string $value */ public function setContentAttribute($value) { $this->attributes['content'] = json_encode($value); } }