Skip to content

Commit 8fb12e1

Browse files
authored
Merge pull request mavinoo#60 from HilbertGilbertson/master
Use Carbon:now() instead of the now() helper
2 parents b7c9a35 + 2f58b0f commit 8fb12e1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Batch.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Mavinoo\Batch\Common\Common;
66
use Illuminate\Database\Eloquent\Model;
77
use Illuminate\Database\DatabaseManager;
8+
use Illuminate\Support\Carbon;
89

910
class Batch implements BatchInterface
1011
{
@@ -74,7 +75,7 @@ public function update(Model $table, array $values, string $index = null, bool $
7475
$updatedAtColumn = $table->getUpdatedAtColumn();
7576

7677
if (!isset($val[$updatedAtColumn])) {
77-
$val[$updatedAtColumn] = now()->format($table->getDateFormat());
78+
$val[$updatedAtColumn] = Carbon::now()->format($table->getDateFormat());
7879
}
7980
}
8081

@@ -289,7 +290,7 @@ public function insert(Model $table, array $columns, array $values, int $batchSi
289290
if ($table->usesTimestamps()) {
290291
$createdAtColumn = $table->getCreatedAtColumn();
291292
$updatedAtColumn = $table->getUpdatedAtColumn();
292-
$now = now()->format($table->getDateFormat());
293+
$now = Carbon::now()->format($table->getDateFormat());
293294

294295
$addCreatedAtValue = false;
295296
$addUpdatedAtValue = false;

0 commit comments

Comments
 (0)