Add syncPropValues method to Propable trait; update StoreProductRequest and UpdateProductRequest to handle props validation
This commit is contained in:
17
app/Domains/Prop/Support/PropRules.php
Normal file
17
app/Domains/Prop/Support/PropRules.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domains\Prop\Support;
|
||||
|
||||
class PropRules
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public static function sync(): array
|
||||
{
|
||||
return [
|
||||
'props' => ['sometimes', 'array'],
|
||||
'props.*' => ['nullable'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user