3 namespace App\Console\Commands;
5 use App\Models\ChatLib;
6 use App\Models\ChatLog;
7 use Illuminate\Console\Command;
9 class ChatlibDatabase extends Command {
12 * The name and signature of the console command.
16 protected $signature = 'chatlib:database';
19 * The console command description.
23 protected $description = 'Updates the ChatLib database';
26 * Execute the console command.
30 public function handle() {
33 ChatLog::where('banned', '=', false)
34 ->whereNotNull('evaluated_at')
35 ->chunk(500, function ($msgs) use ($db) {
36 foreach ($msgs as $msg) {
37 $db->addMessage($msg);
43 for ($i = 0; $i < 50; ++$i) {
44 $this->line($db->generate());