我有一个类似图片的嵌套表格 Nested Form
图片说明:
“ RiskPlacementDetail”到“ RiskPlaceCalculation”的关系调用hasMany
“ RiskPlaceCalculation”到“ RiskPlacementDetail”有一个关系调用belongsTo
如何保存来自每个输入字段的每个数据?
我的RiskPlacementDetail模型
Get-ADUser abc -Properties description | Set-ADUser -Description "($($PSItem.Description).substring(0,10))"
我的RiskPlaceCalculation模型
class RiskPlacementDetail extends Model
{
protected $table = 'tableName';
protected $fillable = ['someField', '...'];
public function risk_plc_calculations()
{
return $this->hasMany(RiskPlcCalculation::class);
}
}