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()
989
989
return $ this ->original [$ this ->getKeyName ()] ?? $ this ->getKey ();
990
990
}
991
991
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
+
992
1002
/**
993
1003
* Perform a model insert operation.
994
1004
*
@@ -1011,7 +1021,7 @@ protected function performInsert(Builder $query)
1011
1021
// If the model has an incrementing key, we can use the "insertGetId" method on
1012
1022
// the query builder, which will give us back the final inserted ID for this
1013
1023
// table from the database. Not all tables have to be incrementing though.
1014
- $ attributes = $ this ->getAttributes ();
1024
+ $ attributes = $ this ->getAttributesForInsert ();
1015
1025
1016
1026
if ($ this ->getIncrementing ()) {
1017
1027
$ this ->insertAndSetId ($ query , $ attributes );
You can’t perform that action at this time.
0 commit comments