Skip to content

Commit

Permalink
feat(serviceProvider): instantiate the Validator::class
Browse files Browse the repository at this point in the history
  • Loading branch information
fnsc committed Feb 9, 2024
1 parent 4bffdeb commit f1705fc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ public function boot(): void

private function registerRules(): void
{
$validator = $this->app->make(Validator::class);

foreach ($this->rules as $rule) {
$rule = $this->app->make($rule);
$alias = $rule->getAlias();
Validator::extend($alias, $rule . '@passes', $rule->message());
$validator->extend($alias, $rule . '@passes', $rule->message());
}
}
}

0 comments on commit f1705fc

Please sign in to comment.