add un-confirm option to user:confirm, hide New button from dashboard if user isn't confirmed
This commit is contained in:
@@ -12,7 +12,7 @@ class ConfirmUser extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'user:confirm {user}';
|
||||
protected $signature = 'user:confirm {user} {--undo}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
@@ -39,7 +39,15 @@ class ConfirmUser extends Command
|
||||
public function handle()
|
||||
{
|
||||
$u = User::resolve($this->argument('user'));
|
||||
$u->update(['confirmed' => true]);
|
||||
$this->info("User #$u->id with e-mail $u->email and handle @$u->name was confirmed.");
|
||||
|
||||
$un='';
|
||||
if ($this->hasOption('undo')) {
|
||||
$u->update(['confirmed' => false]);
|
||||
$un='un';
|
||||
} else {
|
||||
$u->update(['confirmed' => true]);
|
||||
}
|
||||
|
||||
$this->info("User #$u->id with e-mail $u->email and handle @$u->name was {$un}confirmed.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user