Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Commit

Permalink
Including presence verifier for standalone usage
Browse files Browse the repository at this point in the history
  • Loading branch information
igorsantos07 committed Jul 19, 2013
1 parent 87f85c4 commit ff41aae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/LaravelBook/Ardent/Ardent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Illuminate\Support\Facades\Validator;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
use Illuminate\Validation\DatabasePresenceVerifier;
use Illuminate\Validation\Factory as ValidationFactory;
use Symfony\Component\Translation\Loader\PhpFileLoader;
use Symfony\Component\Translation\Translator;
Expand Down Expand Up @@ -380,6 +381,7 @@ public static function configureAsExternal(array $connection) {

self::$externalValidator = true;
self::$validationFactory = new ValidationFactory($translator);
self::$validationFactory->setPresenceVerifier(new DatabasePresenceVerifier($db->manager));
}

/**
Expand Down Expand Up @@ -686,7 +688,7 @@ protected function buildUniqueExclusionRules() {

return $rules;
}

/**
* Update a model already saved in the database.
*
Expand Down

0 comments on commit ff41aae

Please sign in to comment.