Skip to content

Commit 4e0a73a

Browse files
committed
Doc
1 parent ff2dbca commit 4e0a73a

File tree

1 file changed

+44
-37
lines changed

1 file changed

+44
-37
lines changed

README.md

Lines changed: 44 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,13 @@ easily handle a user verification and validate the e-mail.
77

88
**This package is Laravel 5.4 compliant.**
99

10-
A few minor changes remain to be updated for the email markdown support + queue methods.
11-
A 2.3 ; 3.1 ; 4.1 update is coming soon with several improvements.
12-
13-
| 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) |
14-
|---------|-----|-----|-----|--------|
15-
| 5.0.* | x | | | |
16-
| 5.1.* | x | | | |
17-
| 5.2.* | x | | | |
18-
| 5.3.* | | x | | |
19-
| 5.4.* | | | x | x |
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) | [4.0](https://github.com/jrean/laravel-user-verification/tree/4.0) | [4.1](https://github.com/jrean/laravel-user-verification/tree/4.1) | [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 | | | |
16+
| 5.4.* | | | x | x | x |
2017

2118
## ABOUT
2219

@@ -48,7 +45,8 @@ Or run the following command:
4845

4946
### Add the Service Provider & Facade/Alias
5047

51-
Once Larvel User Verification is installed, you need to register the service provider in `config/app.php`. Make sure to add the following line **above** the `RouteServiceProvider`.
48+
Once Larvel User Verification is installed, you need to register the service provider in `config/app.php`.
49+
Make sure to add the following line **above** the `RouteServiceProvider`.
5250

5351
```PHP
5452
Jrean\UserVerification\UserVerificationServiceProvider::class,
@@ -60,6 +58,12 @@ You may add the following `aliases` to your `config/app.php`:
6058
'UserVerification' => Jrean\UserVerification\Facades\UserVerification::class
6159
```
6260

61+
Publish the package config file by running the following command:
62+
63+
```
64+
php artisan vendor:publish --provider="Jrean\UserVerification\UserVerificationServiceProvider" --tag="config"
65+
```
66+
6367
## CONFIGURATION
6468
The model representing the `User` must implement the authenticatable
6569
interface `Illuminate\Contracts\Auth\Authenticatable` which is the default with
@@ -93,9 +97,10 @@ php artisan vendor:publish --provider="Jrean\UserVerification\UserVerificationSe
9397

9498
### Default middleware
9599

96-
This package ships with an optional middleware throwing a `UserNotVerifiedException`. You can setup the desired behaviour, for example a redirect to a specific page, in the `app\Exceptions\Handler.php`. Please refer to the [Laravel Documentation](https://laravel.com/docs/master/errors#the-exception-handler) to learn more about how to work with the exception handler.
100+
This package provides an optional middleware throwing a `UserNotVerifiedException`.
101+
Please refer to the [Laravel Documentation](https://laravel.com/docs/master/errors#the-exception-handler) to learn more about how to work with the exception handler.
97102

98-
To register the default middleware add the following to the `$routeMiddleware` array within the `app/Http/Kernel.php` file:
103+
To register the default middleware add the following lines to the `$routeMiddleware` array within the `app/Http/Kernel.php` file:
99104

100105
```php
101106
protected $routeMiddleware = [
@@ -107,7 +112,7 @@ Apply the middleware on your routes:
107112

108113
```php
109114
Route::group(['middleware' => ['web', 'isVerified']], function () {
110-
115+
//
111116
```
112117

113118
### Custom middleware
@@ -122,11 +127,9 @@ For more details about middlewares, please refer to the [Laravel Documentation](
122127

123128
## E-MAIL
124129

125-
As of this 4.0 release, the markdown support is not yet available.
126-
127130
This package provides a method to send an e-mail with a link containing the verification token.
128131

129-
- `send(AuthenticatableContract $user, $subject = null, $from = null, $name =
132+
- `send(AuthenticatableContract $user, $subject, $from = null, $name =
130133
null)`
131134

132135
By default the package will use the `from` and `name` values defined into the
@@ -147,27 +150,43 @@ The user will receive an e-mail with a link leading to the `getVerification()`
147150
method (endpoint). The view will receive a `$user` variable which contains the
148151
user details such as the verification token.
149152

150-
By default the package loads a sample e-mail view to get you started with:
153+
The package allow you to use both traditional blade view files and markdown.
154+
155+
By default a sample e-mail view is loaded to get you started with:
151156

152157
```
153158
Click here to verify your account: <a href="{{ $link = route('email-verification.check', $user->verification_token) . '?email=' . urlencode($user->email) }}">{{ $link }}</a>
154159
```
155160

161+
If you prefer to use Markdown instead, update the package config file
162+
`user-verification.php` in the `config` directory and replace the following:
163+
164+
```PHP
165+
'email' => [
166+
'type' => 'default',
167+
],
168+
```
169+
170+
by:
171+
172+
```PHP
173+
'email' => [
174+
'type' => 'markdown',
175+
],
176+
```
177+
178+
If you want to customize the e-mail views, run the following command to publish
179+
them and edit them to your needs:
180+
156181
**The URL must contain the verification token as parameter + (mandatory) a
157182
query string with the user's e-mail as parameter.**
158183

159-
If you want to customize the e-mail view, run the following command to publish
160-
it and edit it to your needs:
161-
162184
```
163185
php artisan vendor:publish --provider="Jrean\UserVerification\UserVerificationServiceProvider" --tag="views"
164186
```
165187

166188
The view will be available in the `resources/views/vendor/laravel-user-verification/` directory.
167189

168-
If you want to customize the e-mail view location and name you can create the view file
169-
wherever you want and call `UserVerification::emailView('directory.your-view-name')`.
170-
171190
## ERRORS
172191

173192
This package throws several exceptions. You are free to use `try/catch`
@@ -267,27 +286,15 @@ Send by e-mail a link containing the verification token.
267286

268287
Queue and send by e-mail a link containing the verification token.
269288

270-
* `sendQueueOn($queue, AuthenticatableContract $user, $subject = null, $from = null, $name = null)`
271-
272-
Queue on the given queue and send by e-mail a link containing the verification token.
273-
274289
* `sendLater($seconds, AuthenticatableContract $user, $subject = null, $from = null, $name = null)`
275290

276291
Send later by e-mail a link containing the verification token.
277292

278-
* `sendLaterOn($queue, $seconds, AuthenticatableContract $user, $subject = null, $from = null, $name = null)`
279-
280-
Send later on the given queue by e-mail a link containing the verification token.
281-
282293
* `process($email, $token, $userTable)`
283294

284295
Process the token verification for the given e-mail and token.
285296

286-
* `emailView($name)`
287-
288-
Set the e-mail view name.
289-
290-
For the `sendQueue`, `sendQueueOn`, `sendLater` and
297+
For the `sendQueue`, `sendLater` and
291298
`sendLaterOn` methods, you must [configure your queues](https://laravel.com/docs/)
292299
before using this feature.
293300

0 commit comments

Comments
 (0)