/** * restores a topic, along with its posts and views, to a section */ public static function restoreTopicToSection(\Nexus\Topic $topic, \Nexus\Section $section) { $topic->posts()->restore(); $topic->views()->restore(); $topic->restore(); $topic->section_id = $section->id; $topic->save(); }