Skip to content

Commit ef36741

Browse files
committed
Share same timestamp
1 parent 58cc561 commit ef36741

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Drivers/DatabaseDriver.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,13 @@ public function set($feature, $scope, $value): void
289289
*/
290290
public function setAll(array $features): void
291291
{
292+
$now = Carbon::now();
293+
292294
$this->newQuery()->upsert(array_map(fn (array $feature) => [
293295
'name' => $feature['feature'],
294296
'scope' => Feature::serializeScope($feature['scope']),
295297
'value' => json_encode($feature['value'], flags: JSON_THROW_ON_ERROR),
296-
static::CREATED_AT => $now = Carbon::now(),
298+
static::CREATED_AT => $now,
297299
static::UPDATED_AT => $now,
298300
], $features), uniqueBy: ['name', 'scope'], update: ['value', static::UPDATED_AT]);
299301
}

0 commit comments

Comments
 (0)