File tree Expand file tree Collapse file tree 3 files changed +35
-2
lines changed Expand file tree Collapse file tree 3 files changed +35
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace BeyondCode \EmailConfirmation ;
4
4
5
- use Illuminate \Auth \Events \Registered ;
6
5
use Illuminate \Support \ServiceProvider ;
7
- use BeyondCode \EmailConfirmation \Listeners \CreateConfirmationCode ;
8
6
9
7
class EmailConfirmationServiceProvider extends ServiceProvider
10
8
{
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace BeyondCode \EmailConfirmation \Events ;
4
+
5
+ use Illuminate \Queue \SerializesModels ;
6
+
7
+ /**
8
+ * Class Confirmed
9
+ * @package BeyondCode\EmailConfirmation\Events
10
+ */
11
+ class Confirmed
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
+ }
Original file line number Diff line number Diff line change 2
2
3
3
namespace BeyondCode \EmailConfirmation \Traits ;
4
4
5
+ use BeyondCode \EmailConfirmation \Events \Confirmed ;
5
6
use Illuminate \Http \Request ;
6
7
use Illuminate \Auth \Events \Registered ;
7
8
@@ -27,6 +28,8 @@ public function confirm($confirmation_code)
27
28
$ user ->confirmed_at = now ();
28
29
$ user ->save ();
29
30
31
+ event (new Confirmed ($ user ));
32
+
30
33
return $ this ->confirmed ($ user )
31
34
?: redirect (route ('login ' ))->with ('confirmation ' , __ ('confirmation::confirmation.confirmation_successful ' ));
32
35
}
You can’t perform that action at this time.
0 commit comments