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
|
|
|
|
|
*/
|
2023-04-09 14:53:15 +08:00
|
|
|
protected $signature = 'user:login_notify {--this_id=}';
|
2023-01-31 16:38:21 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The console command description.
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
2023-04-09 14:53:15 +08:00
|
|
|
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');
|
2023-04-09 14:53:15 +08:00
|
|
|
$this->info("thisId: $thisId");
|
|
|
|
|
if (!$thisId) {
|
|
|
|
|
$this->error("require option --this_id=?");
|
2023-04-09 02:33:37 +08:00
|
|
|
return Command::FAILURE;
|
|
|
|
|
}
|
2023-04-09 14:53:15 +08:00
|
|
|
SendLoginNotify::dispatch($thisId);
|
2023-01-31 16:38:21 +08:00
|
|
|
return Command::SUCCESS;
|
|
|
|
|
}
|
|
|
|
|
}
|