From decfcc8e97ec5bdbae635617ab9890718bbc16d4 Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Wed, 29 May 2024 10:21:44 +1000 Subject: [PATCH] reuse method logic --- src/Drivers/DatabaseDriver.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Drivers/DatabaseDriver.php b/src/Drivers/DatabaseDriver.php index 829e899..0e92052 100644 --- a/src/Drivers/DatabaseDriver.php +++ b/src/Drivers/DatabaseDriver.php @@ -326,13 +326,11 @@ protected function update($feature, $scope, $value) */ protected function insert($feature, $scope, $value) { - return $this->newQuery()->insert([ + return $this->insertMany([[ 'name' => $feature, - 'scope' => Feature::serializeScope($scope), - 'value' => json_encode($value, flags: JSON_THROW_ON_ERROR), - static::CREATED_AT => $now = Carbon::now(), - static::UPDATED_AT => $now, - ]); + 'scope' => $scope, + 'value' => $value, + ]]); } /**