Files
nexusphp/app/Console/Commands/UserLoginNotify.php
T

42 lines
900 B
PHP
Raw Normal View History

2023-01-31 16:38:21 +08:00
<?php
namespace App\Console\Commands;
use App\Jobs\GenerateTemporaryInvite;
use App\Jobs\SendLoginNotify;
use Illuminate\Console\Command;
class UserLoginNotify extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'user:login_notify {--this_id=}';
2023-01-31 16:38:21 +08:00
/**
* The console command description.
*
* @var string
*/
protected $description = 'Send login notify, option: --this_id';
2023-01-31 16:38:21 +08:00
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$thisId = $this->option('this_id');
$this->info("thisId: $thisId");
if (!$thisId) {
$this->error("require option --this_id=?");
2023-04-09 02:33:37 +08:00
return Command::FAILURE;
}
SendLoginNotify::dispatch($thisId);
2023-01-31 16:38:21 +08:00
return Command::SUCCESS;
}
}