Skip to content

Commit f9d84b7

Browse files
authored
Extended docs with configuration and usage
1 parent 81269e1 commit f9d84b7

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,51 @@ At least you need to migrate the `%_create_pending_user_emails.php` migration.
5555
php artisan migrate
5656
```
5757

58+
## Configuration
59+
60+
The configuration can be made in the config file `verify-email` or in the published files. All config values have there used file path.
61+
62+
For the verification url the `route.for` is required or go to `app/Traits/Auth/MustVerifyNewEmail` and change it in function `verificationUrl`. When calling the varification link the `route.after` is required to redirect or go to `app/Http/Controllers/Auth/VerifyNewEmailController` and change it in function `__invoke`.
63+
64+
```php
65+
'route' => [
66+
'for' => 'verification.verify',
67+
'after' => 'home',
68+
],
69+
```
70+
71+
You can decide if the user's verification status resets on every email change or go to `app/Traits/Auth/MustVerifyNewEmail` and change it in function `newEmail`.
72+
73+
```php
74+
'reset_verification' => true,
75+
```
76+
77+
You can change the active time of the verification link with a number in minutes or go to `app/Traits/Auth/MustVerifyNewEmail` and change it in function `verificationUrl`.
78+
79+
```php
80+
'expire' => 60,
81+
```
82+
5883
## Usage
5984

85+
When you want to change to user's email you can call the user function `syncEmail`.
86+
6087
```php
6188
$request->user()->syncEmail($request->input('email'));
6289
```
6390

91+
If you need to get the pending email you can call the user function `getPendingEmail`.
92+
93+
```php
94+
$request->user()->getPendingEmail();
95+
```
96+
97+
In case you need to clear the user's pending email call `clearPendingEmail`.
98+
99+
```php
100+
$request->user()->clearPendingEmail();
101+
```
102+
64103
## Changelog
65104

66105
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

0 commit comments

Comments
 (0)