adrema/app/Console/Commands/NamiInitializeCommand.php

53 lines
972 B
PHP
Raw Normal View History

2022-01-03 01:17:24 +01:00
<?php
namespace App\Console\Commands;
use App\Initialize\Initializer;
use Illuminate\Console\Command;
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()
{
try {
app(Initializer::class)->run();
} catch (NamiException $e) {
$e->outputToConsole($this);
2022-03-11 20:19:17 +01:00
return 1;
}
2022-01-03 01:17:24 +01:00
return 0;
}
}