Files
lsky-pro/app/Console/Commands/Upgrade.php
T
2022-02-26 17:46:25 +08:00

46 lines
828 B
PHP

<?php
namespace App\Console\Commands;
use App\Enums\ConfigKey;
use App\Services\UpgradeService;
use App\Utils;
use Illuminate\Console\Command;
class Upgrade extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'lsky:upgrade';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Upgrade Lsky Pro.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle(): int
{
return (int) (new UpgradeService(Utils::config(ConfigKey::AppVersion)))->upgrade();
}
}