我想在表中循环我的包(每个包与测试模型都有belongsToMany关系)&我不知道如何在我的刀片中循环?
public function tests()
{
return $this->belongsToMany('App\Models\Test');
}
这是我的完整表格(刀片):
| Child | Women | Men | Athletes | VIP | ||
|---|---|---|---|---|---|---|
| TestOne | ||||||
| TestTwo | ||||||
| TestThree | ||||||
| TestFour | ||||||
| TestFive | ||||||
| TestSix |
每个 显示之间的数据透视表的一行
设计是:
如何在我的 blde 中循环使用关系模型?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
我通过检查关系以这种方式创建表: