From ed75852dfc5d1d4fbab8ce85a9cd8df21e29c7cd Mon Sep 17 00:00:00 2001 From: Rudie Dirkx <168024+rudiedirkx@users.noreply.github.com> Date: Tue, 18 Apr 2023 21:06:23 +0200 Subject: [PATCH] Use pivot model fromDateTime instead of assuming Carbon (#46822) --- .../Eloquent/Relations/Concerns/InteractsWithPivotTable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php b/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php index ed8a9b7ba8a1..04862e5d80f7 100644 --- a/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php +++ b/src/Illuminate/Database/Eloquent/Relations/Concerns/InteractsWithPivotTable.php @@ -396,7 +396,7 @@ protected function addTimestampsToAttachment(array $record, $exists = false) if ($this->using) { $pivotModel = new $this->using; - $fresh = $fresh->format($pivotModel->getDateFormat()); + $fresh = $pivotModel->fromDateTime($fresh); } if (! $exists && $this->hasPivotColumn($this->createdAt())) {