Changeset View
Changeset View
Standalone View
Standalone View
src/app/Console/Commands/User/Verify.php
- This file was moved from src/app/Console/Commands/UserVerify.php.
<?php | <?php | ||||
namespace App\Console\Commands; | namespace App\Console\Commands\User; | ||||
use Illuminate\Console\Command; | use App\Console\Command; | ||||
class UserVerify extends Command | class Verify 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}'; | ||||
/** | /** | ||||
* The console command description. | * The console command description. | ||||
* | * | ||||
* @var string | * @var string | ||||
*/ | */ | ||||
protected $description = 'Verify the state of a user account'; | protected $description = 'Verify the state of a user account'; | ||||
/** | /** | ||||
* Create a new command instance. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function __construct() | |||||
{ | |||||
parent::__construct(); | |||||
} | |||||
/** | |||||
* Execute the console command. | * Execute the console command. | ||||
* | * | ||||
* @return mixed | * @return mixed | ||||
*/ | */ | ||||
public function handle() | public function handle() | ||||
{ | { | ||||
$user = \App\User::where('email', $this->argument('user'))->first(); | $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\UserVerify($user); | $job = new \App\Jobs\UserVerify($user); | ||||
$job->handle(); | $job->handle(); | ||||
} | } | ||||
} | } |