You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.
use Illuminate\Database\Capsule\Manager as DatabaseCapsule;
use LaravelArdent\Ardent\Ardent;
use Illuminate\Events\Dispatcher;
use Illuminate\Container\Container;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Translation\FileLoader;
use Illuminate\Translation\Translator;
use Illuminate\Validation\Factory as ValidationFactory;
use Illuminate\Validation\DatabasePresenceVerifier;
use Illuminate\Hashing\BcryptHasher;
class BaseModel extends Ardent
{
public $throwOnValidation = true;
public static function configureAsExternal(array $connection, $lang = 'zh-CN') {
$db = new DatabaseCapsule;
$db->addConnection($connection);
$db->setEventDispatcher(new Dispatcher(new Container));
$db->setAsGlobal();
$db->bootEloquent();
$file = new Filesystem();
$fileLoader = new FileLoader($file, dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'lang'.DIRECTORY_SEPARATOR.$lang.DIRECTORY_SEPARATOR);
$translator = new Translator($fileLoader, $lang);
self::$external = true;
self::$validationFactory = new ValidationFactory($translator);
self::$validationFactory->setPresenceVerifier(new DatabasePresenceVerifier($db->getDatabaseManager()));
self::$hasher = new BcryptHasher();
}
}
and when start: BaseModel::configureAsExternal($database);
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
at Ardent.php
line 17:
use Illuminate\Validation\Factory as ValidationFactory;
line 19:
use Symfony\Component\Translation\Translator;
line 512:
$translator = new Translator();
line 519:
self::$validationFactory = new ValidationFactory($translator);
the Illuminate\Validation\Factory needs a Illuminate\Contracts\Translation\Translator Object, but gives Symfony\Component\Translation\Translator
The text was updated successfully, but these errors were encountered: