1$query = DB::table('blog_posts')
2->join('model_names_relations', 'blog_posts.id', '=', 'model_names_relations.blog_post_id')
3->join('model_names', 'model_names.id', '=', 'model_names_relations.model_name_id')
4->where('blog_posts.id', '12')
5->get();