关于laravel 关联关系小结

A.前提:有两个实体表user 和 type user表中有外键type_id 关联 type 表 1.belongsTo :属于 在 user 模型内建立与 type 的关联关系时,用belongsTo; 2.hasMany 在type 模型内建立与 user 关联关系时,若是是一对多 :hasMany; 3.hasOne 在type 模型内建立与 user 关联关系时,若
相关文章
相关标签/搜索