File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 5
5
use Illuminate \Console \Command ;
6
6
use Illuminate \Support \Str ;
7
7
use App \User ;
8
+ use Illuminate \Contracts \Console \PromptsForMissingInput ;
8
9
9
- class UserVerifyEmail extends Command
10
+ class UserVerifyEmail extends Command implements PromptsForMissingInput
10
11
{
11
12
/**
12
13
* The name and signature of the console command.
@@ -39,13 +40,19 @@ public function __construct()
39
40
*/
40
41
public function handle ()
41
42
{
42
- $ user = User::whereUsername ($ this ->argument ('username ' ))->first ();
43
+ $ username = $ this ->argument ('username ' );
44
+ $ user = User::whereUsername ($ username )->first ();
43
45
44
46
if (!$ user ) {
45
47
$ this ->error ('Username not found ' );
46
48
return ;
47
49
}
48
50
51
+ if ($ user ->email_verified_at ) {
52
+ $ this ->error ('Email already verified ' . $ user ->email_verified_at ->diffForHumans ());
53
+ return ;
54
+ }
55
+
49
56
$ user ->email_verified_at = now ();
50
57
$ user ->save ();
51
58
$ this ->info ('Successfully verified email address for ' . $ user ->username );
You can’t perform that action at this time.
0 commit comments