Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ARC-Support
public projects
lou-server
Commits
673cb9b5
Commit
673cb9b5
authored
Jun 21, 2021
by
Maik Messerschmidt
Browse files
Use chunk() instead of cursor().
#1
parent
6139b931
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/ResultController.php
View file @
673cb9b5
...
...
@@ -165,9 +165,11 @@ class ResultController extends Controller
$zip
=
new
ZipStream
(
'results.zip'
,
$options
);
Result
::
cursor
()
->
each
(
function
(
$result
)
use
(
$zip
)
{
$filename
=
$result
->
created_at
.
".json"
;
$zip
->
addFile
(
$filename
,
$result
->
getOriginal
(
"data"
));
Result
::
chunk
(
5
,
function
(
$results
)
use
(
$zip
)
{
foreach
(
$results
as
$result
)
{
$filename
=
$result
->
created_at
.
".json"
;
$zip
->
addFile
(
$filename
,
$result
->
getOriginal
(
"data"
));
}
});
$zip
->
finish
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment