Skip to content

Commit fbaafb7

Browse files
committed
Documentation
1 parent 9888306 commit fbaafb7

File tree

1 file changed

+38
-31
lines changed

1 file changed

+38
-31
lines changed

README.md

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ easily handle a user verification and validate the e-mail.
99
- [x] Send an e-mail with the verification token link
1010
- [x] Handle the verification of the token
1111
- [x] Set the user as verified
12+
- [x] Relaunch the process anytime
1213

1314
## Installation
1415

@@ -181,54 +182,62 @@ this view to your needs.
181182

182183
## Usage
183184

184-
### API
185+
### Routes
185186

186-
The package public API offers three (3) methods.
187+
Add the two (2) default routes to the `app\Http\routes.php` file. Routes are
188+
customizable. If you do so, you must overwrite the corresponding available
189+
redirect attributes/properties listed later.
187190

188-
* `generate(AuthenticatableContract $user)`
191+
```
192+
Route::get('verification/error', 'Auth\AuthController@getVerificationError');
193+
Route::get('verification/{token}', 'Auth\AuthController@getVerification');
194+
```
189195

190-
Generate and save a verification token for the given user.
196+
### Trait
191197

192-
* `send(AuthenticatableContract $user, $subject = null, $from = null, $name =
193-
* null)`
198+
The package offers two (2) traits for a quick implementation.
199+
Only `VerifiesUsers` must be included.
194200

195-
Send by e-mail a link containing the verification token.
201+
`Jrean\UserVerification\Traits\VerifiesUsers`
196202

197-
* `process($email, $token, $userTable)`
203+
which includes:
198204

199-
Process the token verification for the given e-mail and token.
205+
`Jrean\UserVerification\Traits\RedirectsUsers`
200206

201-
### Facade
207+
### Endpoints
202208

203-
The package offers a facade callable with `UserVerification::`.
209+
The two (2) following methods are included into the `VerifiesUsers` trait and
210+
called by the default package routes.
204211

205-
You can use it over the three (3) previous listed public methods.
212+
* `getVerification(Request $request, $token)`
206213

207-
### Trait
214+
Handle the user verification.
208215

209-
The package also offers two (2) traits for a quick implementation.
216+
* `getVerificationError()`
210217

211-
`Jrean\UserVerification\Traits\VerifiesUsers`
218+
Do something if the verification fails.
212219

213-
which includes:
220+
### API
214221

215-
`Jrean\UserVerification\Traits\RedirectsUsers`
222+
The package public API offers three (3) methods.
223+
224+
* `generate(AuthenticatableContract $user)`
216225

217-
#### Endpoints
226+
Generate and save a verification token for the given user.
218227

219-
The two following methods are endpoints you can join by defining the proper
220-
route(s) of your choice.
228+
* `send(AuthenticatableContract $user, $subject = null, $from = null, $name = null)`
221229

222-
* `getVerification(Request $request, $token)`
230+
Send by e-mail a link containing the verification token.
223231

224-
Handle the user verification. It requires a string parameter representing the
225-
verification token to verify.
232+
* `process($email, $token, $userTable)`
226233

227-
* `getVerificationError()`
234+
Process the token verification for the given e-mail and token.
228235

229-
Do something if the verification fails.
236+
### Facade
237+
238+
The package offers a facade `UserVerification::`.
230239

231-
#### Custom attributes/properties
240+
### Custom attributes/properties
232241

233242
To customize the package behaviour and the redirects you can implement and
234243
customize six (6) attributes/properties:
@@ -257,10 +266,10 @@ Name of the view returned by the getVerificationError method.
257266

258267
Name of the default table used for managing users.
259268

260-
#### Custom methods
269+
### Custom methods/attributes/properties
261270

262271
You can easily customize the package behaviour by overriding/overwriting the
263-
public methods. Dig into the source.
272+
public methods and the attributes/properties. Dig into the source.
264273

265274
## Guidelines
266275

@@ -389,9 +398,7 @@ methods provided by Laravel before implementing the package.
389398

390399
Edit the `app\Http\routes.php` file.
391400

392-
- Define two (2) new routes. Routes are customizable.
393-
Don't forget to update the previous listed redirect attributes/properties if you want to
394-
change the pre-defined routes.
401+
- Define two (2) new routes.
395402

396403
```
397404
Route::get('verification/error', 'Auth\AuthController@getVerificationError');

0 commit comments

Comments
 (0)