Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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' => newLandLineVN(),
38-
'mobile_vn' => newMobileVN(),
39-
'id_vn' => newIdVN(),
40-
'ip_vn' => newIpVN(),
41-
'ipv4_vn' => newIpVN(IpVN::IPV4),
42-
'ipv6_vn' => newIpVN(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)

AltStyle によって変換されたページ (->オリジナル) /