From 0b439c57c778f736d31a450c47873b6b53ce5fbd Mon Sep 17 00:00:00 2001 From: Steve Bauman Date: Sun, 9 May 2021 21:07:25 -0400 Subject: [PATCH] Add method for overriding the built-in UserSynchronizer --- src/LdapRecord.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/LdapRecord.php b/src/LdapRecord.php index 6fd9d5b5..6999b690 100644 --- a/src/LdapRecord.php +++ b/src/LdapRecord.php @@ -2,6 +2,8 @@ namespace LdapRecord\Laravel; +use LdapRecord\Laravel\Import\UserSynchronizer; + class LdapRecord { /** @@ -54,4 +56,16 @@ public static function locateUsersUsing($class) { app()->bind(LdapUserRepository::class, $class); } + + /** + * Register a class that should be used for synchronizing LDAP users. + * + * @param string|\Closure $class + * + * @return void + */ + public static function synchronizeUsersUsing($class) + { + app()->bind(UserSynchronizer::class, $class); + } }