I have the following nested foreach loop. While this is executing (it's a biggie) I want follow progress by printing out the output of each iteration as it executes, rather than waiting for it to complete. Just a raw echo would be fine, or even better send the output to a view using AJAX. I'm using Laravel 5.3.
Artist 1:
- Release 1
- Release 2
- Release 3
- ...
Artist 2:
- Release 1
- Release 2
- Release 3
- ...
...
$artists = Artist::all();
foreach($artists as $artist) {
...get_data...
$releases = $data->releasees;
foreach ($releases as $release) {
$artist_release = new ArtistRelease;
artist_release->title = $release->title;
$artist_release->save();
}
}
Cheers!