@@ -87,7 +87,7 @@ php artisan make:migration add_verification_to_users_table --table="users"
8787Once the migration is generated, edit the generated migration file in
8888` database/migration ` with the following lines:
8989
90- ```
90+ ``` PHP
9191 /**
9292 * Run the migrations.
9393 *
@@ -142,15 +142,6 @@ If you want to override the values, simply set the `$from` and (optional)
142142Refer to the Laravel [ documentation] ( https://laravel.com/docs/ ) for the
143143proper e-mail component configuration.
144144
145- ### Resending the verification token
146- If you want to resend the verification token, you can do this with the following two lines:
147-
148- ``` php
149- UserVerification::generate($user);
150- UserVerification::send($user, 'My Custom E-mail Subject');
151- ```
152-
153- The first line will generate a new token and change the users ` verified ` status to 0. The ` send ` method is than used to send a new email to the user.
154145
155146### E-mail View
156147
@@ -214,7 +205,7 @@ The view will be available in the `resources/views/vendor/laravel-user-verificat
214205Add the two (2) default routes to the ` routes/web.php ` file. Routes are
215206customizable.
216207
217- ```
208+ ``` PHP
218209 Route::get('verification/error', 'Auth\RegisterController@getVerificationError');
219210 Route::get('verification/{token}', 'Auth\RegisterController@getVerification');
220211```
@@ -345,7 +336,7 @@ Edit the `routes/web.php` file.
345336
346337- Define two (2) new routes.
347338
348- ```
339+ ``` PHP
349340 Route::get('verification/error', 'Auth\RegisterController@getVerificationError');
350341 Route::get('verification/{token}', 'Auth\RegisterController@getVerification');
351342```
@@ -361,8 +352,7 @@ Edit the `app\Http\Controllers\Auth\RegisterController.php` file.
361352- [ ] Overwrite the contructor (not mandatory)
362353- [x] Overwrite the ` register() ` method (mandatory)
363354
364- ```
365-
355+ ``` PHP
366356 namespace App\Http\Controllers\Auth;
367357
368358 use App\User;
@@ -453,7 +443,6 @@ Edit the `app\Http\Controllers\Auth\RegisterController.php` file.
453443 return redirect($this->redirectPath());
454444 }
455445 }
456-
457446```
458447
459448At this point, after registration, an e-mail is sent to the user.
@@ -464,10 +453,21 @@ If you want to perform the verification against an authenticated user you must
464453update the middleware exception to allow ` getVerification ` and
465454` getVerificationError ` routes to be accessed.
466455
467- ```
456+ ``` PHP
468457$this->middleware('guest', ['except' => ['getVerification', 'getVerificationError']]);
469458```
470459
460+ ## Relaunch the process anytime
461+
462+ If you want to regenerate and resend the verification token, you can do this with the following two lines:
463+
464+ ``` php
465+ UserVerification::generate($user);
466+ UserVerification::send($user, 'My Custom E-mail Subject');
467+ ```
468+
469+ The ` generate ` method will generate a new token for the given user and change the ` verified ` column to 0. The ` send ` method will send a new email to the user.
470+
471471## Contribute
472472
473473Feel free to comment, contribute and help. 1 PR = 1 feature.
0 commit comments