Add syncPropValues method to Propable trait; update StoreProductRequest and UpdateProductRequest to handle props validation

This commit is contained in:
2026-06-22 12:36:41 -03:00
parent 894f2a68de
commit 054a3a81eb
5 changed files with 43 additions and 2 deletions

View File

@@ -60,6 +60,16 @@ trait Propable
);
}
/**
* @param array<string, mixed> $props
*/
public function syncPropValues(array $props): void
{
foreach ($props as $codigo => $value) {
$this->setPropValue($codigo, $value);
}
}
public function deletePropValue(Prop|string $prop): bool
{
$resolvedProp = $this->resolveProp($prop);