需求是这样的,
我有user表、文章article表
user表结构
id
name
email
...
article表结构
id
title
content
...
user表和article表会产生以下关系
1、收藏
2、点赞
3、回复
4、关注
我是不是得建4个Model
article_user_collect
article_user_point
article_user_reply
article_user_attention
每个表只有user_id 和 article_id
而laravel模型中多对多的关系中介绍不适合这种情况!!!
因为这不是多对多。
还是推荐创建 comments ,favorites 等四个表