Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #13 from Dropelikeit/bugfix/create-rule-problem-wi…
Browse files Browse the repository at this point in the history
…th_php8.0

Bugfix/create rule problem with php8.0
  • Loading branch information
Dropelikeit authored Sep 27, 2021
2 parents b80a28b + 2db89e1 commit 1746c55
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\ServiceProvider as BaseServiceProvider;
use MarcelStrahl\TemporaryValidator\Rule\IsNotAnTemporaryEmailAddress;
use TemporaryEmailDetection\ClientFactory;
use TemporaryEmailDetection\ClientFactoryInterface;

/**
* @author Marcel Strahl <[email protected]>
Expand All @@ -17,6 +19,10 @@ public function boot(): void
{
$this->loadTranslationsFrom(__DIR__ . '/../translations', 'temporary-email-validator');

$this->app->bind(ClientFactoryInterface::class, static function (): ClientFactoryInterface {
return new ClientFactory();
});

Validator::extend('not_temporary_email', function ($attribute, $value, $parameters, $validator): bool {
/** @var IsNotAnTemporaryEmailAddress $rule */
$rule = App::make(IsNotAnTemporaryEmailAddress::class);
Expand Down

0 comments on commit 1746c55

Please sign in to comment.