pivot en relacion

This commit is contained in:
Alejandro Tasistro 2024-03-15 01:34:57 -03:00
parent 9155f974b6
commit 382b973227
2 changed files with 2 additions and 2 deletions

View File

@ -29,6 +29,6 @@ public function barrio(): BelongsTo
*/
public function productos(): BelongsToMany
{
return $this->belongsToMany(Producto::class);
return $this->belongsToMany(Producto::class)->withPivot(['cantidad','total']);
}
}

View File

@ -29,7 +29,7 @@ public function categoria(): BelongsTo
*/
public function pedidos(): BelongsToMany
{
return $this->belongsToMany(Pedido::class);
return $this->belongsToMany(Pedido::class)->withPivot(['cantidad','total']);
}
/**