count(); $words = UserDict::where('dict_id', $dict_id) ->select([ 'word', 'factors', ])->cursor(); foreach ($words as $key => $word) { $output = array($word->word, $word->factors); fwrite($fp, implode("\t", $output) . "\n"); if ($key % 100 === 0) { $present = (int)($key * 100 / $total); $this->info("[{$present}%]-{$key}"); } } fclose($fp); Log::info((time() - $start) . ' seconds'); $this->call('export:zip', [ 'id' => 'ai-pali-word-token', 'filename' => $exportFile, 'title' => 'ai pali word token', 'format' => $this->option('format'), ]); return 0; } }