File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -148,18 +148,18 @@ public static function createFromRecord($record)
148
148
149
149
public static function createModelsFromRecordSet (BaseCollection $ records ): Collection
150
150
{
151
- // return an empty Eloquent/Collection (or a collection of the specific model type ) if an empty collection was
151
+ // return an empty Eloquent/Collection (or the custom collection specified in the model) if an empty collection was
152
152
// passed in.
153
153
if ($ records ->count () === 0 ) {
154
- return (new static ())->newCollection ([] );
154
+ return (new static ())->newCollection ();
155
155
}
156
156
157
157
// Records passed in weren't empty, so process the records
158
158
$ mappedRecords = $ records ->map (function ($ record ) {
159
159
return static ::createFromRecord ($ record );
160
160
});
161
161
162
- // return the filled Eloquent/Collection (or a collection of the specific model type if possible )
162
+ // return the filled Eloquent/Collection (or the custom collection specified in the model)
163
163
return (new static ())->newCollection ($ mappedRecords ->all ());
164
164
}
165
165
You can’t perform that action at this time.
0 commit comments