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