public static function fetch_topic_by_node_id($node_id) { return Topic::with('node')->where('node_id', '=', $node_id)->get(); }
public function index() { $topic = Topic::with('node', 'user', 'favorite')->paginate(15); return view("index", compact('topic')); }
public function node($node_id) { return view('posts.node')->with('topic', Topic::with('node', 'user', 'favorite')->node($node_id)->paginate(15)); }