]> git.localhorst.tv Git - alttp.git/blob - app/Console/Commands/ChatlibGenerate.php
5ea85f6838bcc19a326c9dbb8cc88eb626ed5ac3
[alttp.git] / app / Console / Commands / ChatlibGenerate.php
1 <?php
2
3 namespace App\Console\Commands;
4
5 use App\Models\ChatLib;
6 use Illuminate\Console\Command;
7
8 class ChatlibGenerate extends Command {
9
10         /**
11          * The name and signature of the console command.
12          *
13          * @var string
14          */
15         protected $signature = 'chatlib:generate {which=de} {amount=50}';
16
17         /**
18          * The console command description.
19          *
20          * @var string
21          */
22         protected $description = 'Generates samples from a ChatLib database';
23
24         /**
25          * Execute the console command.
26          *
27          * @return int
28          */
29         public function handle() {
30                 $db = new ChatLib();
31                 $db->loadFrom($this->argument('which'));
32
33                 $amount = intval($this->argument('amount'));
34                 for ($i = 0; $i < $amount; ++$i) {
35                         $this->line($db->generate());
36                 }
37
38                 return 0;
39         }
40
41 }
42
43 ?>