| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function boot() |
||
| 16 | { |
||
| 17 | /* |
||
| 18 | * Custom validation rules |
||
| 19 | */ |
||
| 20 | 93 | Validator::extend('alpha_spaces_hyphens_apostrophes', function ($attribute, $value) { |
|
| 21 | // Accept only alpha, spaces, hyphens and apostrophes. |
||
| 22 | 7 | return preg_match('/^[\pL\s-\']+$/u', $value); |
|
| 23 | 93 | }); |
|
| 24 | |||
| 25 | 93 | Validator::extend('alpha_spaces_hyphens_apostrophes_parentheses_slashes_dots', function ($attribute, $value) { |
|
| 26 | // Accept only alpha, spaces, hyphens, apostrophes, parentheses, slashes and dots. |
||
| 27 | 7 | return preg_match('/^[\pL\s-\'()\/.]+$/u', $value); |
|
| 28 | 93 | }); |
|
| 41 |