| Total Complexity | 7 |
| Total Lines | 71 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class FormInviteSend extends Model |
||
| 15 | { |
||
| 16 | const TOKEN_VALID_TIME = 604800; // 7 days |
||
| 17 | |||
| 18 | public $email; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Before execute method. Cleanup deprecated invites |
||
| 22 | */ |
||
| 23 | public function before() |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Form display labels |
||
| 30 | * @return array |
||
| 31 | */ |
||
| 32 | public function labels(): array |
||
| 36 | ]; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Validation rules |
||
| 41 | * @return array |
||
| 42 | */ |
||
| 43 | public function rules(): array |
||
| 49 | ]; |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Send invite to email |
||
| 54 | * @return bool |
||
| 55 | */ |
||
| 56 | public function make() |
||
| 73 | } |
||
| 74 | |||
| 75 | /** |
||
| 76 | * Generate unique invite string |
||
| 77 | * @return string |
||
| 78 | */ |
||
| 79 | private function makeInvite() |
||
| 87 |