我已经使用belongsToMany函数创建了多对多关系: class Doctor extends Model...public function categories() return $this->belongsToMany('App\Category', 'doctors_to_categories', 'doctor_id', 'category_id');...
} 现在我想创建具有多对多
我有一个关系,需要进行不同的过滤,这取决于Laravel领域,它是用来填充。A single Locations has one or more Locations attached as options A single Process_type“我的位置”资源中的字段如下:
BelongsToMany::make('Neighborhood Locations', 'relatedLocations', Location::class)它描述了将
A City hasMany Spots.Artists和Spots也通过belongsToMany联系在一起,因为一个Spot可能具有多个Artists的特性。我现在想在City中定义一个关系,它给我所有在该City中有特色的艺术家(所以基本上是寻找与该City中的某个地点相关的艺术家)
有没有我可以使用的关系类型?