Example #1
0
 public static function getByEmail($email)
 {
     // check to see if there is an LDAP connection for this environment
     //
     $ldapConnectionConfig = Config::get('ldap.connections.' . App::environment());
     if ($ldapConnectionConfig != null) {
         // use LDAP
         //
         return LDAP::getByEmail($email);
     } else {
         // use SQL / Eloquent
         //
         return User::where('email', '=', $email)->first();
     }
 }