public static function findByExternalId($externalId)
    {
        if (gettype($externalId) == 'string') {
            $externalId = ['external_id' => $externalId];
        }

        $response = static::all($externalId);

        if (is_null($response)) {
            return null;
        } else {
            return $response->first();
        }
    }
public static function findByExternalId($externalId)
    {
        if (gettype($externalId) == 'string') {
            $externalId = ['external_id' => $externalId];
        }

        $response = static::all($externalId);

        if (is_null($response)) {
            return null;
        } else {
            return $response->first();
        }
    }
public static function findByExternalId ( $ externalId ) { if ( gettype ( $ externalId ) == 'string' ) { $ externalId = [ 'external_id' => $ externalId ] ; } $ response = static :: all ( $ externalId ) ; if ( is_null ( $ response ) ) { return null ; } else { return $ response -> first ( ) ; } }
Find a Customer by External ID. Returns only first result!
@param string $externalId
@return Customer
Find a Customer by External ID . Returns only first result!