File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -196,13 +196,11 @@ public function firstOrFail(): Model
196196 /**
197197 * Get all the models from the cache.
198198 */
199- public function get (): Collection
199+ public function get (int $ chunk = 1000 ): Collection
200200 {
201201 $ models = $ this ->model ->newCollection ();
202202
203- $ this ->each (
204- fn (Model $ model ) => $ models ->add ($ model )
205- );
203+ $ this ->each (fn (Model $ model ) => $ models ->add ($ model ), $ chunk );
206204
207205 return $ models ;
208206 }
@@ -218,7 +216,7 @@ public function exists(): bool
218216 /**
219217 * Execute a callback over each item.
220218 */
221- public function each (Closure $ callback , int $ count = 100 ): void
219+ public function each (Closure $ callback , int $ count = 1000 ): void
222220 {
223221 $ this ->chunk ($ count , function (Collection $ models ) use ($ callback ) {
224222 foreach ($ models as $ key => $ model ) {
You can’t perform that action at this time.
0 commit comments