我不能使用多对多多态关系在急切加载中选择列Etape::with(array('entreprises'=> function($query) {}))->get();class Etape extends Eloquent {
public function entreprisesreturn $this->morphTo
我正在尝试创建一个简单的表之间的关系: - attribute_products - name
id price 用于链接它们的数据透视表->belongsToMany(Product::Class,'attribute_product_values','attribute_id','product_id');
} 如何从透视表中获取
我在Laravel 9项目中有以下关系:class Student extends Model public function grade() returnbelongsToMany(Student::class, 'protocol_student')->withPivot('current_grade_id', 'new_grade_id');}
多到多的关系具有以下数据库结构constra