File tree Expand file tree Collapse file tree 2 files changed +2
-10
lines changed Expand file tree Collapse file tree 2 files changed +2
-10
lines changed Original file line number Diff line number Diff line change 20
20
"php" : " ^8.1" ,
21
21
"brick/phonenumber" : " ^0.4.0" ,
22
22
"byrokrat/banking" : " ^2.2" ,
23
- "intervention/validation" : " ^3.2" ,
24
23
"laravel/framework" : " ^9.0" ,
25
24
"personnummer/personnummer" : " ^3.0.4" ,
26
25
"organisationsnummer/organisationsnummer" : " ^1.0.0" ,
Original file line number Diff line number Diff line change 3
3
namespace TantHammar \LaravelRules \Rules ;
4
4
5
5
use Illuminate \Contracts \Validation \Rule ;
6
- use Intervention \Validation \Rules \Luhn ;
7
6
use Organisationsnummer \Organisationsnummer ;
8
- use TantHammar \LaravelExtras \CleanNumber ;
7
+ use TantHammar \LaravelExtras \NoWhiteSpace ;
9
8
10
9
/** Validates SWEDISH business numbers */
11
10
class OrgNummer implements Rule
@@ -22,13 +21,7 @@ public function passes($attribute, $value): bool
22
21
if (blank ($ value )) {
23
22
return false ;
24
23
}
25
- return Organisationsnummer::valid ($ value ); //only returns bool (catches errors)
26
- /*
27
- try {
28
- return (new Luhn)->passes(attribute: null, value: CleanNumber::make($value));
29
- } catch (\Exception $e) {
30
- return false;
31
- }*/
24
+ return Organisationsnummer::valid (NoWhiteSpace::make ($ value )); //only returns bool (catches errors)
32
25
}
33
26
34
27
/**
You can’t perform that action at this time.
0 commit comments