diff --git a/packages/Webkul/CartRule/src/Repositories/CartRuleRepository.php b/packages/Webkul/CartRule/src/Repositories/CartRuleRepository.php index 4fb0afd71ae..b72d279be23 100755 --- a/packages/Webkul/CartRule/src/Repositories/CartRuleRepository.php +++ b/packages/Webkul/CartRule/src/Repositories/CartRuleRepository.php @@ -45,9 +45,9 @@ public function model(): string */ public function create(array $data) { - $data['starts_from'] = $data['starts_from'] ?? null; + $data['starts_from'] = $data['starts_from'] ?: null; - $data['ends_till'] = $data['ends_till'] ?? null; + $data['ends_till'] = $data['ends_till'] ?: null; $data['status'] = isset($data['status']); @@ -82,8 +82,8 @@ public function create(array $data) public function update(array $data, $id, $attribute = 'id') { $data = array_merge($data, [ - 'starts_from' => $data['starts_from'] ?? null, - 'ends_till' => $data['ends_till'] ?? null, + 'starts_from' => $data['starts_from'] ?: null, + 'ends_till' => $data['ends_till'] ?: null, 'status' => isset($data['status']), 'conditions' => $data['conditions'] ?? [], ]);