Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/User/VerifyCommand.php
- This file was moved from src/app/Console/Commands/UserVerify.php.
<?php | <?php | ||||
namespace App\Console\Commands; | namespace App\Console\Commands\User; | ||||
use App\Console\Command; | use App\Console\Command; | ||||
class UserVerify extends Command | class VerifyCommand extends Command | ||||
{ | { | ||||
/** | /** | ||||
* The name and signature of the console command. | * The name and signature of the console command. | ||||
* | * | ||||
* @var string | * @var string | ||||
*/ | */ | ||||
protected $signature = 'user:verify {user}'; | protected $signature = 'user:verify {user}'; | ||||
Show All 9 Lines | class VerifyCommand extends Command | ||||
* | * | ||||
* @return mixed | * @return mixed | ||||
*/ | */ | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
$user = $this->getUser($this->argument('user')); | $user = $this->getUser($this->argument('user')); | ||||
if (!$user) { | if (!$user) { | ||||
$this->error("User not found."); | |||||
return 1; | return 1; | ||||
} | } | ||||
$this->info("Found user: {$user->id}"); | |||||
$job = new \App\Jobs\User\VerifyJob($user->id); | $job = new \App\Jobs\User\VerifyJob($user->id); | ||||
$job->handle(); | $job->handle(); | ||||
// TODO: We should check the job result and print an error on failure | |||||
} | } | ||||
} | } |