且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

多对多关系

更新时间:2021-12-16 09:58:35

你需要为多对多关系使用另一种多态方法: https://github.com/laravel/framework/blob/master/src/Illuminate/Database/Eloquent/Model.php#L805 morhpToMany belongsToMany 将相关模型作为参数传递。

You need to use another polymorphic method for a many-to-many relationship: https://github.com/laravel/framework/blob/master/src/Illuminate/Database/Eloquent/Model.php#L805 morhpToMany and belongsToMany where you pass the related model as a parameter.