Why are you using both the BelongsTo and BelongsToMany Nova fields?
You should only use the BelongsToMany since that's the relationship you're trying to work with.
i have a Resource with this fields
public function fields(Request $request) { return [ BelongsTo::make('Material'),
BelongsToMany::make('Materials')
->fields(function() {
return [
Number::make('Quantity'),
Boolean::make('Need Test'),
];
})
];
}
MODEL public function material() : BelongsTo { return $this->belongsTo(Material::class); }
public function materials() : BelongsToMany
{
return $this->belongsToMany(Material::class, 'warehouse_chemical_formula_materials');
}
when i try to attach material i only get 1 input for material selection i cant add other info like quantity and need test.
when i remove BelongsTo::make('Material'),
i can add that field. anyone know how to fix this issue?
Please or to participate in this conversation.