mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 05:04:07 -08:00
Add conditional
This commit is contained in:
parent
1d5b48b88d
commit
30bd920497
|
@ -47,12 +47,14 @@ class StoreAssetRequest extends ImageUploadRequest
|
||||||
{
|
{
|
||||||
$modelRules = (new Asset)->getRules();
|
$modelRules = (new Asset)->getRules();
|
||||||
|
|
||||||
// If purchase_cost was submitted as a string with a comma separator
|
if (is_string($this->input('purchase_cost'))) {
|
||||||
// then we need to ignore the normal numeric rules.
|
// If purchase_cost was submitted as a string with a comma separator
|
||||||
// Since the original rules still live on the model they will be run
|
// then we need to ignore the normal numeric rules.
|
||||||
// right before saving (and after purchase_cost has been
|
// Since the original rules still live on the model they will be run
|
||||||
// converted to a float via setPurchaseCostAttribute).
|
// right before saving (and after purchase_cost has been
|
||||||
$modelRules = $this->removeNumericRulesFromPurchaseCost($modelRules);
|
// converted to a float via setPurchaseCostAttribute).
|
||||||
|
$modelRules = $this->removeNumericRulesFromPurchaseCost($modelRules);
|
||||||
|
}
|
||||||
|
|
||||||
return array_merge(
|
return array_merge(
|
||||||
$modelRules,
|
$modelRules,
|
||||||
|
|
Loading…
Reference in a new issue