Skip to content

Commit e11ccaf

Browse files
committed
Refactor user_id assignment in update method to use empty check
1 parent d4b8a53 commit e11ccaf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/Webkul/Contact/src/Repositories/PersonRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function create(array $data)
7474
*/
7575
public function update(array $data, $id, $attributes = [])
7676
{
77-
$data['user_id'] = $data['user_id'] ?: null;
77+
$data['user_id'] = empty($data['user_id']) ? null : $data['user_id'];
7878

7979
$person = parent::update($data, $id);
8080

0 commit comments

Comments
 (0)