post->created_uuid = $data['created_uuid']; $this->post->updated_uuid = $data['updated_uuid']; $this->post->thread_uuid = $data['thread_uuid']; $this->post->title = $data['title']; $this->post->content = $data['content']; if($this->post->save()) { $this->post->users()->sync($data['users'] ?? []); $this->post->groups()->sync($data['groups'] ?? []); return $this->post; } return false; } }