Skip to content

Commit 4250018

Browse files
committed
2 parents 8d081fc + 9223a89 commit 4250018

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

src/Events/UserVerified.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
/**
3+
* This file is part of Jrean\UserVerification package.
4+
*
5+
* (c) Jean Ragouin <[email protected]> <www.askjong.com>
6+
*/
7+
namespace Jrean\UserVerification\Events;
8+
9+
use Illuminate\Queue\SerializesModels;
10+
11+
class UserVerified
12+
{
13+
use SerializesModels;
14+
15+
/**
16+
* The authenticated user.
17+
*
18+
* @var \Illuminate\Contracts\Auth\Authenticatable
19+
*/
20+
public $user;
21+
22+
/**
23+
* Create a new event instance.
24+
*
25+
* @param \Illuminate\Contracts\Auth\Authenticatable $user
26+
* @return void
27+
*/
28+
public function __construct($user)
29+
{
30+
$this->user = $user;
31+
}
32+
}

src/UserVerification.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Illuminate\Database\Schema\Builder;
1212
use Illuminate\Support\Facades\DB;
1313
use Illuminate\Support\Str;
14+
use Jrean\UserVerification\Events\UserVerified;
1415
use Jrean\UserVerification\Events\VerificationEmailSent;
1516
use Jrean\UserVerification\Exceptions\ModelNotCompliantException;
1617
use Jrean\UserVerification\Exceptions\TokenMismatchException;
@@ -275,6 +276,8 @@ protected function wasVerified($user)
275276
$user->verified = true;
276277

277278
$this->updateUser($user);
279+
280+
event(new UserVerified($user));
278281
}
279282

280283
/**

0 commit comments

Comments
 (0)