| Total Complexity | 5 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 9 | trait ActivationTrait |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Trigger Activation Email |
||
| 13 | * Note: this was build pre laravel verification emails. |
||
| 14 | * |
||
| 15 | * @param User $user |
||
| 16 | * |
||
| 17 | * @return void |
||
| 18 | */ |
||
| 19 | public function initiateEmailActivation(User $user) |
||
| 20 | { |
||
| 21 | if (! config('settings.activation') || ! $this->validateEmail($user)) { |
||
| 22 | return true; |
||
| 23 | } |
||
| 24 | |||
| 25 | $activationRepostory = new ActivationRepository(); |
||
| 26 | $activationRepostory->createTokenAndSendEmail($user); |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Validate the Users Email. |
||
| 31 | * |
||
| 32 | * @param User $user |
||
| 33 | * |
||
| 34 | * @return bool |
||
| 35 | */ |
||
| 36 | protected function validateEmail(User $user) |
||
| 45 | } |
||
| 46 | } |
||
| 47 |