Skip to content

Commit 955f7b8

Browse files
committed
Merge branch 'master' into 3.0
2 parents 97ac5b9 + ed126aa commit 955f7b8

File tree

4 files changed

+50
-11
lines changed

4 files changed

+50
-11
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,15 @@ No user found for the given e-mail adresse.
187187

188188
### Error View
189189

190-
Create a view for the default verification error route `/verification/error` at
191-
`resources/views/errors/user-verification.blade.php`. If an error occurs, the
192-
user will be redirected to this route and this view will be rendered. **You
193-
must implement and customize this view to your needs.** For instance you may
194-
wish to display a short message saying that something went wrong and then ask
195-
for the user's e-mail again and start the process from scratch (generate, send,
196-
verify, ...).
190+
By default the `user-verification.blade.php` view will be loaded for the verification error route `/verification/error`. If an error occurs, the user will be redirected to this route and this view will be rendered.
191+
192+
**You may customize this view to your needs.** To do so first publish the view to your resources folder:
193+
194+
```
195+
php artisan vendor:publish --tag=laravel-user-verification-views
196+
```
197+
198+
The view will be available in the `resources/views/vendor/laravel-user-verification/` directory and can be customized.
197199

198200
## Usage
199201

@@ -296,7 +298,7 @@ Where to redirect after a failling token verification.
296298

297299
Name of the view returned by the getVerificationError method.
298300

299-
* `$verificationEmailView = 'emails.user-verification';`
301+
* `$verificationErrorView = 'errors.user-verification';`
300302

301303
Name of the default e-mail view.
302304

@@ -346,8 +348,6 @@ Edit the `app\Http\Controllers\Auth\RegisterController.php` file.
346348
- [ ] Overwrite and customize the redirect attributes/properties paths
347349
available within the `RedirectsUsers` trait included by the
348350
`VerifiesUsers` trait. (not mandatory)
349-
- [ ] Overwrite the default error view name used by the `getVerificationError()` method
350-
(not mandatory)
351351
- [x] Create the verification error view at
352352
`resources/views/errors/user-verification.blade.php` (mandatory)
353353
- [ ] Overwrite the contructor (not mandatory)

src/Traits/VerifiesUsers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected function validateRequest(Request $request)
7474
*/
7575
protected function verificationErrorView()
7676
{
77-
return property_exists($this, 'verificationErrorView') ? $this->verificationErrorView : 'errors.user-verification';
77+
return property_exists($this, 'verificationErrorView') ? $this->verificationErrorView : 'laravel-user-verification::user-verification';
7878
}
7979

8080
/**

src/UserVerificationServiceProvider.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@
1111

1212
class UserVerificationServiceProvider extends ServiceProvider
1313
{
14+
/**
15+
* Perform post-registration booting of services.
16+
*
17+
* @return void
18+
*/
19+
public function boot()
20+
{
21+
$this->loadViewsFrom(__DIR__.'/resources/views', 'laravel-user-verification');
22+
23+
$this->publishes([
24+
__DIR__.'/resources/views' => resource_path('views/vendor/laravel-user-verification'),
25+
], 'laravel-user-verification-views');
26+
}
1427
/**
1528
* Register the service provider.
1629
*
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@extends('layouts.app')
2+
3+
<!-- Main Content -->
4+
@section('content')
5+
<div class="container">
6+
<div class="row">
7+
<div class="col-md-8 col-md-offset-2">
8+
<div class="panel panel-default">
9+
<div class="panel-heading">Verification failed</div>
10+
<div class="panel-body">
11+
<span class="help-block">
12+
<strong>Your account could not be verified.</strong>
13+
</span>
14+
<div class="form-group">
15+
<div class="col-md-12">
16+
<a href="{{url('/')}}" class="btn btn-primary">
17+
Back
18+
</a>
19+
</div>
20+
</div>
21+
</div>
22+
</div>
23+
</div>
24+
</div>
25+
</div>
26+
@endsection

0 commit comments

Comments
 (0)