| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function getEmailValidationRule(): string |
||
| 21 | { |
||
| 22 | $uniqueRule = Rule::unique('users_back', 'email'); |
||
| 23 | |||
| 24 | if ($this->method() === 'PATCH') { |
||
| 25 | $userId = $this->getRouteParameter('administrator'); |
||
| 26 | |||
| 27 | $uniqueRule = $uniqueRule->ignore($userId); |
||
| 28 | } |
||
| 29 | |||
| 30 | return "required|email|{$uniqueRule}"; |
||
| 31 | } |
||
| 32 | } |
||
| 33 |