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 ca78dc4

Browse files
Prepare for next version
1 parent a586618 commit ca78dc4

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

‎CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Tất cả lịch sử tiến trình phát triển thư viện
44

5+
# 1.0.3
6+
7+
- Sửa lỗi lazy load service provider đè lên thư viện.
8+
59
# 1.0.2
610

711
- Cải thiện performance thông qua lazy load service provider.

‎src/ServiceProvider.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@
1212
use PHPViet\Laravel\Validation\Rules\IpVN;
1313
use PHPViet\Laravel\Validation\Rules\MobileVN;
1414
use PHPViet\Laravel\Validation\Rules\LandLineVN;
15-
use Illuminate\Contracts\Support\DeferrableProvider;
1615
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
1716

1817
/**
1918
* @author Vuong Minh <vuongxuongminh@gmail.com>
2019
* @since 1.0.0
2120
*/
22-
class ServiceProvider extends BaseServiceProviderimplements DeferrableProvider
21+
class ServiceProvider extends BaseServiceProvider
2322
{
2423
public function boot(): void
2524
{
@@ -30,15 +29,17 @@ public function boot(): void
3029
protected function loadTrans(): void
3130
{
3231
$this->publishes([
33-
__DIR__.'/../resources/lang' => resource_path('lang/vendor/phpVietValidation'),
32+
__DIR__ . '/../resources/lang' => resource_path('lang/vendor/phpVietValidation'),
3433
]);
35-
$this->loadTranslationsFrom(__DIR__.'/../resources/lang/', 'phpVietValidation');
34+
$this->loadTranslationsFrom(__DIR__ . '/../resources/lang/', 'phpVietValidation');
3635
}
3736

3837
protected function loadExt(): void
3938
{
40-
foreach ($this->getCallableRules() as $name => $rule) {
41-
$this->app['validator']->extend($name, $rule, $rule->message());
39+
if (isset($this->app['validator'])) {
40+
foreach ($this->getCallableRules() as $name => $rule) {
41+
$this->app['validator']->extend($name, $rule, $rule->message());
42+
}
4243
}
4344
}
4445

@@ -54,8 +55,4 @@ protected function getCallableRules(): array
5455
];
5556
}
5657

57-
public function provides(): array
58-
{
59-
return ['validator'];
60-
}
6158
}

0 commit comments

Comments
(0)

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