2022-01-03 01:17:24 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
|
|
|
|
use App\Initialize\Initializer;
|
|
|
|
use Illuminate\Console\Command;
|
|
|
|
use Zoomyboy\LaravelNami\Nami;
|
2022-02-19 22:50:06 +01:00
|
|
|
use Zoomyboy\LaravelNami\NamiException;
|
2022-01-03 01:17:24 +01:00
|
|
|
|
|
|
|
class NamiInitializeCommand extends Command
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The name and signature of the console command.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $signature = 'nami:initialize {--mglnr=} {--password=} {--group_id=}';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The console command description.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $description = 'Initializes nami';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new command instance.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Execute the console command.
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function handle()
|
|
|
|
{
|
2022-02-19 22:50:06 +01:00
|
|
|
try {
|
|
|
|
app(Initializer::class)->run();
|
|
|
|
} catch (NamiException $e) {
|
|
|
|
$e->outputToConsole($this);
|
|
|
|
return 1;
|
|
|
|
}
|
2022-01-03 01:17:24 +01:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|