@@ -16,43 +16,43 @@ public function configurePackage(Package $package): void
16
16
17
17
public function bootingPackage (): void
18
18
{
19
+ $ this ->bootTranslations ();
20
+
19
21
Validator::extend ('alpha_space ' , static function ($ attribute , $ value ) {
20
22
return is_string ($ value ) && preg_match ('/^[\pL\s]+$/u ' , $ value );
21
- });
23
+ }, __ ( ' laravel-rules::messages.alpha_space ' ) );
22
24
23
25
Validator::extend ('alpha_num_space ' , static function ($ attribute , $ value ) {
24
26
if (! is_string ($ value ) && ! is_numeric ($ value )) {
25
27
return false ;
26
28
}
27
29
28
30
return preg_match ('/^[\pL\pM\pN\s]+$/u ' , $ value ) > 0 ;
29
- });
31
+ }, __ ( ' laravel-rules::messages.alpha_num_space ' ) );
30
32
31
33
Validator::extend ('alpha_dash_space ' , static function ($ attribute , $ value ) {
32
34
if (! is_string ($ value ) && ! is_numeric ($ value )) {
33
35
return false ;
34
36
}
35
37
36
38
return preg_match ('#^[ \\\/\pL\s\pM\pN.,_-]+$#u ' , $ value ) > 0 ;
37
- });
39
+ }, __ ( ' laravel-rules::messages.alpha_dash_space ' ) );
38
40
39
41
Validator::extend ('alpha_dash_space_and ' , static function ($ attribute , $ value ) {
40
42
if (! is_string ($ value ) && ! is_numeric ($ value )) {
41
43
return false ;
42
44
}
43
45
44
46
return preg_match ('#^[ \\\/\pL\s\pM\pN.&,_-]+$#u ' , $ value ) > 0 ;
45
- });
47
+ }, __ ( ' laravel-rules::messages.alpha_dash_space_and ' ) );
46
48
47
49
Validator::extend ('alpha_dash_space_at ' , static function ($ attribute , $ value ) {
48
50
if (! is_string ($ value ) && ! is_numeric ($ value )) {
49
51
return false ;
50
52
}
51
53
52
54
return preg_match ('#^[ \\\/\pL\s\pM\pN.@,_-]+$#u ' , $ value ) > 0 ;
53
- });
54
-
55
- $ this ->bootTranslations ();
55
+ }, __ ('laravel-rules::messages.alpha_dash_space_at ' ));
56
56
}
57
57
58
58
//override spatie package shortname() that strips out 'laravel'
0 commit comments