Skip to content

Commit eabbe68

Browse files
Updated ServiceProdivder using container to make rules
1 parent e6785cc commit eabbe68

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/ServiceProvider.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace PHPViet\Laravel\Validation;
1010

11-
use PHPViet\Validation\Rules\IdVN;
11+
use PHPViet\Laravel\Validation\Rules\IdVN;
1212
use PHPViet\Laravel\Validation\Rules\IpVN;
1313
use PHPViet\Laravel\Validation\Rules\MobileVN;
1414
use PHPViet\Laravel\Validation\Rules\LandLineVN;
@@ -34,12 +34,12 @@ public function boot(): void
3434
protected function getCallableRules(): array
3535
{
3636
return [
37-
'land_line_vn' => new LandLineVN(),
38-
'mobile_vn' => new MobileVN(),
39-
'id_vn' => new IdVN(),
40-
'ip_vn' => new IpVN(),
41-
'ipv4_vn' => new IpVN(IpVN::IPV4),
42-
'ipv6_vn' => new IpVN(IpVN::IPV6),
37+
'land_line_vn' => $this->app->make(LandLineVN::class),
38+
'mobile_vn' => $this->app->make(MobileVN::class),
39+
'id_vn' => $this->app->make(IdVN::class),
40+
'ip_vn' => $this->app->make(IpVN::class),
41+
'ipv4_vn' => $this->app->make(IpVN::class, [IpVN::IPV4]),
42+
'ipv6_vn' => $this->app->make(IpVN::class, [IpVN::IPV6])
4343
];
4444
}
4545
}

0 commit comments

Comments
 (0)