@@ -41,7 +41,6 @@ Or run the following command:
4141
4242 "composer require jrean/laravel-user-verification"
4343
44-
4544### Add the Service Provider
4645
4746Once Larvel User Verification is installed, you need to register the service provider.
@@ -73,21 +72,21 @@ the Eloquent `User` model.
7372Generate the migration file with the following artisan command:
7473
7574```
76- php artisan make:migration add_verification_to_:table_table --table=":table"
75+ php artisan make:migration add_verification_to_:table_table --table=":table"
7776```
7877
7978Where ` :table ` is replaced by the table name of your choice.
8079
8180For instance, if you want to keep the default Eloquent ` User ` table:
8281
8382```
84- php artisan make:migration add_verification_to_users_table --table="users"
83+ php artisan make:migration add_verification_to_users_table --table="users"
8584```
8685
8786Once the migration is generated, edit the generated migration file in
8887` database/migration ` with the following lines:
8988
90- ```
89+ ``` PHP
9190 /**
9291 * Run the migrations.
9392 *
@@ -121,7 +120,7 @@ Where `:table` is replaced by the table name of your choice.
121120Migrate the migration with the following command:
122121
123122```
124- php artisan migrate
123+ php artisan migrate
125124```
126125
127126## E-mail
@@ -134,7 +133,9 @@ This package provides a method to send an e-mail with a link containing the veri
134133By default the package will use the ` from ` and ` name ` values defined into the
135134` config/mail.php ` file:
136135
136+ ``` PHP
137137 'from' => ['address' => '', 'name' => ''],
138+ ```
138139
139140If you want to override the values, simply set the ` $from ` and (optional)
140141` $name ` parameters.
@@ -159,7 +160,7 @@ Here is a sample e-mail view content to get you started with:
159160query string with the user's e-mail as parameter.**
160161
161162```
162- Click here to verify your account: <a href="{{ $link = url('verification', $user->verification_token) . '?email=' . urlencode($user->email) }}"> {{ $link }}</a>
163+ Click here to verify your account: <a href="{{ $link = url('verification', $user->verification_token) . '?email=' . urlencode($user->email) }}"> {{ $link }}</a>
163164```
164165
165166## Errors
@@ -204,7 +205,7 @@ The view will be available in the `resources/views/vendor/laravel-user-verificat
204205Add the two (2) default routes to the ` app\Http\routes.php ` file. Routes are
205206customizable.
206207
207- ```
208+ ``` PHP
208209 Route::get('verification/error', 'Auth\AuthController@getVerificationError');
209210 Route::get('verification/{token}', 'Auth\AuthController@getVerification');
210211```
@@ -335,7 +336,7 @@ Edit the `app\Http\routes.php` file.
335336
336337- Define two (2) new routes.
337338
338- ```
339+ ``` PHP
339340 Route::get('verification/error', 'Auth\AuthController@getVerificationError');
340341 Route::get('verification/{token}', 'Auth\AuthController@getVerification');
341342```
@@ -354,7 +355,7 @@ Edit the `app\Http\Controllers\Auth\AuthController.php` file.
354355- [x] Overwrite the ` postRegister() ` /` register() ` method depending on the
355356 Laravel version you use (mandatory)
356357
357- ```
358+ ``` PHP
358359
359360 namespace App\Http\Controllers\Auth;
360361
@@ -476,10 +477,21 @@ If you want to perform the verification against an authenticated user you must
476477update the middleware exception to allow ` getVerification ` and
477478` getVerificationError ` routes to be accessed.
478479
480+ ``` PHP
481+ $this->middleware($this->guestMiddleware(), ['except' => ['logout', 'getVerification', 'getVerificationError']]);
479482```
480- $this->middleware($this->guestMiddleware(), ['except' => ['logout', 'getVerification', 'getVerificationError']]);
483+
484+ ## Relaunch the process anytime
485+
486+ If you want to regenerate and resend the verification token, you can do this with the following two lines:
487+
488+ ``` PHP
489+ UserVerification::generate($user);
490+ UserVerification::send($user, 'My Custom E-mail Subject');
481491```
482492
493+ 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 e-mail to the user.
494+
483495## Contribute
484496
485497Feel free to comment, contribute and help. 1 PR = 1 feature.
0 commit comments