@@ -5,14 +5,17 @@ easily handle a user verification and validate the e-mail.
5
5
6
6
## VERSIONS
7
7
8
- ** This package is Laravel 5.3 compliant.**
9
-
10
- | laravel/branch | [ 2.2] ( https://github.com/jrean/laravel-user-verification/tree/2.2 ) | [ 3.0] ( https://github.com/jrean/laravel-user-verification/tree/3.0 ) | [ master] ( https://github.com/jrean/laravel-user-verification/tree/master ) |
11
- | ---------| -----| -----| --------|
12
- | 5.0.* | x | | |
13
- | 5.1.* | x | | |
14
- | 5.2.* | x | | |
15
- | 5.3.* | | x | x |
8
+ ** This package is Laravel 5.4 compliant.**
9
+ A few minor changes remain to be updated for the email queue methods.
10
+ A 2.3 ; 3.1 ; 4.1 update is coming soon with several improvements.
11
+
12
+ | laravel/branch | [ 2.2] ( https://github.com/jrean/laravel-user-verification/tree/2.2 ) | [ 3.0] ( https://github.com/jrean/laravel-user-verification/tree/3.0 ) | [ 4.0] ( https://github.com/jrean/laravel-user-verification/tree/4.0 ) | [ master] ( https://github.com/jrean/laravel-user-verification/tree/master ) |
13
+ | ---------| -----| -----| -----| --------|
14
+ | 5.0.* | x | | | |
15
+ | 5.1.* | x | | | |
16
+ | 5.2.* | x | | | |
17
+ | 5.3.* | | x | | |
18
+ | 5.4.* | | | x | x |
16
19
17
20
## ABOUT
18
21
@@ -369,15 +372,15 @@ Edit the `app\Http\Controllers\Auth\RegisterController.php` file.
369
372
namespace App\Http\Controllers\Auth;
370
373
371
374
use App\User;
372
- use Validator;
373
375
use App\Http\Controllers\Controller;
376
+ use Illuminate\Support\Facades\Validator;
374
377
use Illuminate\Foundation\Auth\RegistersUsers;
375
- use Illuminate\Http\Request;
376
378
379
+ use Illuminate\Http\Request;
380
+ use Illuminate\Auth\Events\Registered;
377
381
use Jrean\UserVerification\Traits\VerifiesUsers;
378
382
use Jrean\UserVerification\Facades\UserVerification;
379
383
380
-
381
384
class RegisterController extends Controller
382
385
{
383
386
/*
@@ -391,10 +394,18 @@ Edit the `app\Http\Controllers\Auth\RegisterController.php` file.
391
394
|
392
395
*/
393
396
397
+
394
398
use RegistersUsers;
395
399
396
400
use VerifiesUsers;
397
401
402
+ /**
403
+ * Where to redirect users after registration.
404
+ *
405
+ * @var string
406
+ */
407
+ protected $redirectTo = '/home';
408
+
398
409
/**
399
410
* Create a new controller instance.
400
411
*
@@ -407,7 +418,7 @@ Edit the `app\Http\Controllers\Auth\RegisterController.php` file.
407
418
$this->middleware('guest', ['except' => ['getVerification', 'getVerificationError']]);
408
419
}
409
420
410
- /**
421
+ /**
411
422
* Get a validator for an incoming registration request.
412
423
*
413
424
* @param array $data
@@ -448,13 +459,19 @@ Edit the `app\Http\Controllers\Auth\RegisterController.php` file.
448
459
$this->validator($request->all())->validate();
449
460
450
461
$user = $this->create($request->all());
462
+
463
+ event(new Registered($user));
464
+
451
465
$this->guard()->login($user);
452
466
453
467
UserVerification::generate($user);
468
+
454
469
UserVerification::send($user, 'My Custom E-mail Subject');
455
470
456
- return redirect($this->redirectPath());
471
+ return $this->registered($request, $user)
472
+ ?: redirect($this->redirectPath());
457
473
}
474
+
458
475
}
459
476
```
460
477
0 commit comments