protected function extendsAuth()
{
$authenticator = config('doctrine.auth.authenticator', null);
if (!is_null($authenticator) && class_exists($authenticator)) {
\Auth::extend('doctrine.auth', function (Application $app) use($authenticator) {
return $app->make($authenticator, [config('doctrine.auth.model')]);
});
}
}