1 | <?php |
||
9 | trait MustVerifyNewEmail |
||
10 | { |
||
11 | /** |
||
12 | * Deletes all previous attempts for this user, creates a new model/token |
||
13 | * to verify the given email address and send the verification URL |
||
14 | * to the new email address. |
||
15 | * |
||
16 | * @param string $email |
||
17 | * @return \ProtoneMedia\LaravelVerifyNewEmail\PendingUserEmail|null |
||
18 | */ |
||
19 | public function newEmail(string $email):?PendingUserEmail |
||
36 | |||
37 | /** |
||
38 | * Returns the pending email address. |
||
39 | * |
||
40 | * @return string|null |
||
41 | */ |
||
42 | public function getPendingEmail():?string |
||
46 | |||
47 | /** |
||
48 | * Deletes the pending email address models for this user. |
||
49 | * |
||
50 | * @return void |
||
51 | */ |
||
52 | public function clearPendingEmail() |
||
56 | |||
57 | /** |
||
58 | * Sends the VerifyNewEmail Mailable to the new email address. |
||
59 | * |
||
60 | * @param \ProtoneMedia\LaravelVerifyNewEmail\PendingUserEmail $pendingUserEmail |
||
61 | * @return mixed |
||
62 | */ |
||
63 | public function sendPendingEmailVerificationMail(PendingUserEmail $pendingUserEmail) |
||
67 | |||
68 | /** |
||
69 | * Grabs the pending user email address, generates a new token and sends the Mailable. |
||
70 | * |
||
71 | * @return \ProtoneMedia\LaravelVerifyNewEmail\PendingUserEmail|null |
||
72 | */ |
||
73 | public function resendPendingEmailVerificationMail():?PendingUserEmail |
||
79 | } |
||
80 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: