@@ -15,6 +15,7 @@ To get the latest version of Laravel User Verification, simply add the following
1515the require block of your composer.json file:
1616
1717 "jrean/laravel-user-verification": "dev-master"
18+ "jrean/laravel-user-verification": "2.0"
1819
1920or
2021
@@ -116,11 +117,11 @@ an e-mail with a link that points to the getVerification method (typically
116117routed at /auth/verification/{token}) of the AuthController. You will need to
117118create a view for this e-mail at
118119resources/views/emails/user-verification.blade.php. The view will receive the
119- $model variable which contains the user information such as the verification
120+ ` $user ` variable which contains the user information such as the verification
120121token. Here is an example e-mail view to get you started:
121122
122123```
123- Click here to verify your account {{ url('auth/verification/' . $model->verification_token) }}
124+ Click here to verify your account {{ url('auth/verification/' . $model->verification_token) }}
124125```
125126
126127## Usage
@@ -129,19 +130,19 @@ Click here to verify your account {{ url('auth/verification/' . $model->verifica
129130
130131The package public API offers four (4) methods.
131132
132- * ` generate(AuthenticatableContract $model ) `
133+ * ` generate(AuthenticatableContract $user ) `
133134
134135Generate and save a verification token the given user.
135136
136- * ` send(AuthenticatableContract $model , $subject = null) `
137+ * ` send(AuthenticatableContract $user , $subject = null) `
137138
138139Send by email a link containing the verification token.
139140
140- * ` process(AuthenticatableContract $model , $token) `
141+ * ` process(AuthenticatableContract $user , $token) `
141142
142143Process the token verification for the given user.
143144
144- * ` isVerified(AuthenticatableContract $model ) `
145+ * ` isVerified(AuthenticatableContract $user ) `
145146
146147Check if the given user is verified.
147148
@@ -197,12 +198,20 @@ Where to redirect after a failling verification token verification.
197198
198199Name of the view returned by the getVerificationError method.
199200
201+ * ` $userTable = 'users'; `
202+
203+ Name of the default table used for managing users.
204+
200205## Example
201206
202207This package whishes to let you be creative while offering you a predefined
203208path. The following examples assume you have configured Laravel for the
204209package as well as created and migrated the migration according to this
205210documentation.
211+ This package doesn't require the user to be authenticated to perform the
212+ verification. You are free to implement any flow you may want to achieve.
213+ Note that by default the behaviour of Laravel is to return an authenticated
214+ user straight after the registration.
206215
207216### Example 1
208217
@@ -216,8 +225,8 @@ Edit the `app\Http\Controller\Auth\AuthController.php` file.
216225- Overwrite and customize the view name for the getVerificationError method
217226 (not mandatory)
218227- Create the verification error view according to the defined path (mandatory)
219- - Overwrite the contructor (mandatory)
220- - Overwrite the postRegister method (mandatory)
228+ - Overwrite the contructor (not mandatory)
229+ - Overwrite the postRegister/register method (mandatory)
221230
222231```
223232 ...
@@ -238,13 +247,11 @@ Edit the `app\Http\Controller\Auth\AuthController.php` file.
238247 */
239248 public function __construct()
240249 {
241- $this->middleware('auth', ['only' => ['getVerification', 'getVerificationError']]);
242-
243250 // Laravel 5.0.*|5.1.*
244- $this->middleware('guest', ['except' => ['getLogout', 'getVerification', 'getVerificationError' ]]);
251+ $this->middleware('guest', ['except' => ['getLogout']]);
245252
246253 // Laravel 5.2.*
247- $this->middleware('guest', ['except' => ['logout', 'getVerification', 'getVerificationError' ]]);
254+ $this->middleware('guest', ['except' => ['logout']]);
248255 }
249256
250257 ...
@@ -267,7 +274,8 @@ Edit the `app\Http\Controller\Auth\AuthController.php` file.
267274
268275 $user = $this->create($request->all());
269276
270- Auth::login($user);
277+ // Authenticating the user is not mandatory at all.
278+ //Auth::login($user);
271279
272280 UserVerification::generate($user);
273281
0 commit comments