| Total Complexity | 2 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 8 | class AppServiceProvider extends ServiceProvider |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Bootstrap any application services. |
||
| 12 | * |
||
| 13 | * @return void |
||
| 14 | */ |
||
| 15 | 106 | public function boot() |
|
| 16 | { |
||
| 17 | /* |
||
| 18 | * Custom validation rules |
||
| 19 | */ |
||
| 20 | Validator::extend('alpha_spaces_hyphens_apostrophes', function ($attribute, $value) { |
||
| 21 | // Accept only alpha, spaces, hyphens and apostrophes. |
||
| 22 | 8 | return preg_match('/^[\pL\s\-\']+$/u', $value); |
|
| 23 | 106 | }); |
|
| 24 | |||
| 25 | Validator::extend('alpha_spaces_hyphens_apostrophes_parentheses_slashes_dots', function ($attribute, $value) { |
||
| 26 | // Accept only alpha, spaces, hyphens, apostrophes, parentheses, slashes and dots. |
||
| 27 | 8 | return preg_match('/^[\pL\s\-\'()\/.]+$/u', $value); |
|
| 28 | 106 | }); |
|
| 29 | 106 | } |
|
| 30 | |||
| 31 | /** |
||
| 32 | * Register any application services. |
||
| 33 | * |
||
| 34 | * @return void |
||
| 35 | */ |
||
| 36 | 106 | public function register() |
|
| 38 | // |
||
| 39 | 106 | } |
|
| 41 |