PHPackages                             carmelosantana/sendadf - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. carmelosantana/sendadf

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

carmelosantana/sendadf
======================

Library to build valid Auto-Lead Data Format ADF/XML leads.

0.3.0(1y ago)63885MITPHPPHP ^8.1

Since Feb 10Pushed 1y ago4 watchersCompare

[ Source](https://github.com/carmelosantana/sendadf)[ Packagist](https://packagist.org/packages/carmelosantana/sendadf)[ RSS](/packages/carmelosantana-sendadf/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

[![SendADF](https://camo.githubusercontent.com/a7d9f531bf3222a0008a825721e1ecd2d67f776ecd625b06c58cc5d7ae06c102/68747470733a2f2f6361726d656c6f73616e74616e612e636f6d2f656e746974792f64353861333336362d653239342d343239372d383362362d303365363930636632383133)](https://camo.githubusercontent.com/a7d9f531bf3222a0008a825721e1ecd2d67f776ecd625b06c58cc5d7ae06c102/68747470733a2f2f6361726d656c6f73616e74616e612e636f6d2f656e746974792f64353861333336362d653239342d343239372d383362362d303365363930636632383133)
================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#)

PHP library that builds valid Auto-Lead Data Format ADF/XML leads.

- [Install](#install)
- [Usage](#usage)
    - [Basic lead](#basic-lead)
    - [Output](#output)
    - [Default values](#default-values)
- [Examples](#examples)
- [Support](#support)
- [Funding](#funding)
- [Changelog](#changelog)
- [License](#license)

**Supports**

- [ADF 1.0](https://github.com/carmelosantana/sendadf/blob/main/docs/adf-1.0.dtd)

**Features**

- Complete ADF implementation
- Validate tags and attributes *(optional)*
- Custom tags and attributes
- Data entry via an associative `array`, `object`, or `JSON`
- Attempts date conversion to [ISO 8601:1988](https://en.wikipedia.org/wiki/ISO_8601)
- Default attributes for `name`, `phone`, `prospect`, and `vehicle`

---

Install
-------

[](#install)

Include SendADF in your project with [Composer](https://getcomposer.org/):

```
composer require carmelosantana/sendadf
```

**Requirements:**

- [PHP](https://www.php.net/manual/en/install.php) 8.1 or above
- [Composer](https://getcomposer.org/)

Usage
-----

[](#usage)

### Basic lead

[](#basic-lead)

This [example](https://github.com/carmelosantana/sendadf/blob/main/examples/example-1.php) lead represents the minimum data required to comply with ADF specifications.

```
$adf = ( new CarmeloSantana\SendAdf\SendAdf() )
    ->addProspect( 'new' )
    ->addRequestdate( '2/9/2020 6:26PM' )
    ->addVehicle( [
        'year' => 1999,
        'make' => 'Chevrolet',
        'model' => 'Blazer'
    ], 'buy', 'used' )
    ->addCustomer()
        ->addContact()
            ->addName( 'John Doe' )
            ->addPhone( '393-999-3922' )
    ->addVendor()
        ->addContact()
            ->addName( 'Acura of Bellevue' );
```

### Output

[](#output)

Basic output with no tabs.

```
echo $adf->getXml();
```

```

2020-02-09T18:26:00-05:001999ChevroletBlazerJohn Doe393-999-3922Acura of Bellevue
```

Pretty print output.

```
echo $adf->getPrettyPrintXML();
```

```

    2020-02-09T18:26:00-05:00

      1999
      Chevrolet
      Blazer

        John Doe
        393-999-3922

        Acura of Bellevue

```

### Default values

[](#default-values)

Default attribute values are added if none are supplied. This is to adhere to the ADF standard.

```
$adf = ( new CarmeloSantana\SendAdf\SendAdf() )
    ->addRequestdate()
    ->addVehicle( [
        'year' => 2020,
        'make' => 'Chevrolet',
        'model' => 'Blazer'
    ] )
    ->addCustomer()
        ->addContact()
            ->addName( 'John Doe' )
            ->addPhone( '393-999-3922' );

echo $adf->getPrettyPrintXML();
```

```

    2021-02-09T19:32:16-05:00

      1999
      Chevrolet
      Blazer

        John Doe
        393-999-3922

```

- `prospect` tag is opened with status new without calling `addProspect`.
- `addRequestdate` current server time is used as the default for `requestdate` when none is provided.
- `name` part and type are provided.
- `phone` type and time are provided.

Default values can be avoided by using `addProspectparent_node` and `addNode` as seen in [example 3](https://github.com/carmelosantana/sendadf/blob/main/examples/example-3.php).

Sending empty values as shown in [example 1](https://github.com/carmelosantana/sendadf/blob/main/examples/example-1.php) can disable these attributes as well.

Examples
--------

[](#examples)

[Example 1](https://github.com/carmelosantana/sendadf/blob/main/examples/example-1.php)

- Bare minimum to get started

[Example 2](https://github.com/carmelosantana/sendadf/blob/main/examples/example-2.php)

- Full document with all elements and attribute examples

[Example 3](https://github.com/carmelosantana/sendadf/blob/main/examples/example-3.php)

- Avoid default values
- Manually open and close nodes

[Example 4](https://github.com/carmelosantana/sendadf/blob/main/examples/example-4.php)

- Disable validation
- Custom tags and attributes

[Example 5](https://github.com/carmelosantana/sendadf/blob/main/examples/example-5.php)

- Data entry via `arrays`, `objects` and `JSON`

Support
-------

[](#support)

Community support available on [Discord](https://discord.gg/VCMvAMSJfg).

Funding
-------

[](#funding)

If you find this project useful or use it in a commercial environment please consider donating today with one of the following options.

- Bitcoin `bc1qhxu9yf9g5jkazy6h4ux6c2apakfr90g2rkwu45`
- Ethereum `0x9f5D6dd018758891668BF2AC547D38515140460f`
- Patreon [`patreon.com/carmelosantana`](https://www.patreon.com/carmelosantana)
- PayPal [`https://www.paypal.com/donate`](https://www.paypal.com/donate?hosted_button_id=WHCW333MC7CNW)

Changelog
---------

[](#changelog)

- **0.3.0** - Aug 6, 2024
    - Fix psr-4 namespace
    - Update all methods from underscores to camelCase
    - Update PHP requirements

License
-------

[](#license)

The code is licensed [MIT](https://opensource.org/licenses/MIT) and the documentation is licensed [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1281 days

Total

2

Last Release

643d ago

PHP version history (2 changes)0.2.0PHP &gt;=7.2

0.3.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/597820?v=4)[Carmelo Santana](/maintainers/carmelosantana)[@carmelosantana](https://github.com/carmelosantana)

---

Top Contributors

[![carmelosantana](https://avatars.githubusercontent.com/u/597820?v=4)](https://github.com/carmelosantana "carmelosantana (38 commits)")

---

Tags

adfauto-leadautomotivecrmformat-xmlleadphpvehiclexmlxmlcrmleadsautomotiveadfvehicleauto-lead

### Embed Badge

![Health badge](/badges/carmelosantana-sendadf/health.svg)

```
[![Health](https://phpackages.com/badges/carmelosantana-sendadf/health.svg)](https://phpackages.com/packages/carmelosantana-sendadf)
```

###  Alternatives

[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[jms/serializer

Library for (de-)serializing data of any complexity; supports XML, and JSON.

2.3k135.8M851](/packages/jms-serializer)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)[jms/serializer-bundle

Allows you to easily serialize, and deserialize data of any complexity

1.8k89.3M627](/packages/jms-serializer-bundle)[hassankhan/config

Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files

97513.5M170](/packages/hassankhan-config)[sabre/xml

sabre/xml is an XML library that you may not hate.

52832.2M131](/packages/sabre-xml)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
