Skip to content

Commit ed75852

Browse files
authored
Use pivot model fromDateTime instead of assuming Carbon (#46822)
1 parent 6f575fc commit ed75852

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ protected function addTimestampsToAttachment(array $record, $exists = false)
396396
if ($this->using) {
397397
$pivotModel = new $this->using;
398398

399-
$fresh = $fresh->format($pivotModel->getDateFormat());
399+
$fresh = $pivotModel->fromDateTime($fresh);
400400
}
401401

402402
if (! $exists && $this->hasPivotColumn($this->createdAt())) {

0 commit comments

Comments
 (0)