File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,8 @@ public static function createFromRecord($record)
148148
149149 public static function createModelsFromRecordSet (BaseCollection $ records ): Collection
150150 {
151- // return an empty collection if an empty collection was passed in.
151+ // return an empty Eloquent/Collection (or a collection of the specific model type) if an empty collection was
152+ // passed in.
152153 if ($ records ->count () === 0 ) {
153154 return (new static ())->newCollection ([]);
154155 }
@@ -158,6 +159,7 @@ public static function createModelsFromRecordSet(BaseCollection $records): Colle
158159 return static ::createFromRecord ($ record );
159160 });
160161
162+ // return the filled Eloquent/Collection (or a collection of the specific model type if possible)
161163 return (new static ())->newCollection ($ mappedRecords ->all ());
162164 }
163165
You can’t perform that action at this time.
0 commit comments