File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/Illuminate/Database/Eloquent Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -989,6 +989,16 @@ protected function getKeyForSaveQuery()
989989 return $ this ->original [$ this ->getKeyName ()] ?? $ this ->getKey ();
990990 }
991991
992+ /**
993+ * Get all of the current attributes on the model for insert.
994+ *
995+ * @return array
996+ */
997+ protected function getAttributesForInsert ()
998+ {
999+ return $ this ->getAttributes ();
1000+ }
1001+
9921002 /**
9931003 * Perform a model insert operation.
9941004 *
@@ -1011,7 +1021,7 @@ protected function performInsert(Builder $query)
10111021 // If the model has an incrementing key, we can use the "insertGetId" method on
10121022 // the query builder, which will give us back the final inserted ID for this
10131023 // table from the database. Not all tables have to be incrementing though.
1014- $ attributes = $ this ->getAttributes ();
1024+ $ attributes = $ this ->getAttributesForInsert ();
10151025
10161026 if ($ this ->getIncrementing ()) {
10171027 $ this ->insertAndSetId ($ query , $ attributes );
You can’t perform that action at this time.
0 commit comments