PHPackages                             divineomega/uxdm-spatie-data-transfer-object - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. divineomega/uxdm-spatie-data-transfer-object

Abandoned → [jord-jd/uxdm-spatie-data-transfer-object](/?search=jord-jd%2Fuxdm-spatie-data-transfer-object)Library[Utility &amp; Helpers](/categories/utility)

divineomega/uxdm-spatie-data-transfer-object
============================================

Spatie Data Transfer Object package for the UXDM data migrator

v3.0.0(2mo ago)251[1 PRs](https://github.com/Jord-JD/uxdm-spatie-data-transfer-object/pulls)LGPL-3.0-onlyPHPPHP ^7.4 || ^8.0

Since Sep 4Pushed 2mo agoCompare

[ Source](https://github.com/Jord-JD/uxdm-spatie-data-transfer-object)[ Packagist](https://packagist.org/packages/divineomega/uxdm-spatie-data-transfer-object)[ GitHub Sponsors](https://github.com/DivineOmega)[ RSS](/packages/divineomega-uxdm-spatie-data-transfer-object/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (5)Versions (4)Used By (0)

🔀 UXDM Spatie Data Transfer Object
==================================

[](#-uxdm-spatie-data-transfer-object)

[![Build Status](https://camo.githubusercontent.com/90ab9f0fb8b1c52700846aafdc749d3e96a1af210f1055b0bcc48f988e57dcd3/68747470733a2f2f7472617669732d63692e636f6d2f4a6f72642d4a442f7578646d2d7370617469652d646174612d7472616e736665722d6f626a6563742e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/Jord-JD/uxdm-spatie-data-transfer-object)[![Coverage Status](https://camo.githubusercontent.com/032bdbe563d2aea42d7af18c023e200cf1505c90619baabe12d3fa2a56df57f2/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4a6f72642d4a442f7578646d2d7370617469652d646174612d7472616e736665722d6f626a6563742f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/Jord-JD/uxdm-spatie-data-transfer-object?branch=master)

The UXDM Spatie Data Transfer Object package provides a UXDM source and destination for Data Transfer Objects that are created using the [Spatie Data Transfer Object package](https://github.com/spatie/data-transfer-object).

If you have not used UXDM before to migrate your data, visit the [UXDM GitHub repository](https://github.com/Jord-JD/uxdm) to learn more.

Installation
------------

[](#installation)

To install the UXDM Spatie Data Transfer Object package, just run the following composer command.

```
composer require jord-jd/uxdm-spatie-data-transfer-object
```

UXDM Spatie Data Transfer Object Source
---------------------------------------

[](#uxdm-spatie-data-transfer-object-source)

The UXDM Spatie Data Transfer Object source allows you to source data from a Spatie Data Transfer Object Collection.

### Creating

[](#creating)

To create a new Spatie Data Transfer Object source, you must provide it with a populated Spatie Data Transfer Object Collection.

The following example creates a Spatie Data Transfer Object source object, using a collection of users data transfer objects.

```
$users = new UserDTOCollection([
    new UserDTO([
        'id' => 1,
        'name' => 'Picard`',
        'email' => 'picard@enterprise-d.com',
    ]),
    new UserDTO([
        'id' => 2,
        'name' => 'Janeway',
        'email' => 'janeway@voyager.com',
    ])
]);

$spatieDataTransferObjectSource = new SpatieDataTransferObjectSource($users);
```

### Assigning to migrator

[](#assigning-to-migrator)

To use the Spatie Data Transfer Object source as part of a UXDM migration, you must assign it to the migrator. This process is the same for most sources.

```
$migrator = new Migrator;
$migrator->setSource($spatieDataTransferObjectSource);
```

UXDM Spatie Data Transfer Object Destination
--------------------------------------------

[](#uxdm-spatie-data-transfer-object-destination)

The UXDM Spatie Data Transfer Object destination allows you to migrate data into a Spatie Data Transfer Object Collection.

### Creating

[](#creating-1)

To create a new Spatie Data Transfer Object destination, you must provide it with a Spatie Data Transfer Object Collection, and the class name of a Spatie Data Transfer Object.

The following example creates a Spatie Data Transfer Object destination object, using an empty collection, and the name of a user data transfer object class.

```
$users = new UserDTOCollection();
$spatieDataTransferObjectDestination = new SpatieDataTransferObjectDestination($users, UserDTO::class);
```

### Assigning to migrator

[](#assigning-to-migrator-1)

To use the Spatie Data Transfer Object destination as part of a UXDM migration, you must assign it to the migrator. This process is the same for most destinations.

```
$migrator = new Migrator;
$migrator->setDestination($spatieDataTransferObjectDestination);
```

Alternatively, you can add multiple destinations, as shown below. You can also specify the fields you wish to send to each destination by passing an array of field names as the second parameter.

```
$migrator = new Migrator;
$migrator->addDestination($spatieDataTransferObjectDestination, ['field1', 'field2']);
$migrator->addDestination($otherDestination, ['field3', 'field2']);
```

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance83

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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 ~1177 days

Total

3

Last Release

87d ago

Major Versions

v1.0.0 → v2.0.02026-02-14

v2.0.0 → v3.0.02026-02-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/c580cdf7c14898fff179cdfc1085892091d5d2f49d917873a12365af9ac77c93?d=identicon)[Jord-JD](/maintainers/Jord-JD)

---

Top Contributors

[![Jord-JD](https://avatars.githubusercontent.com/u/650645?v=4)](https://github.com/Jord-JD "Jord-JD (22 commits)")

---

Tags

data-transfer-objectspatiespatie-data-transferuxdm

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/divineomega-uxdm-spatie-data-transfer-object/health.svg)

```
[![Health](https://phpackages.com/badges/divineomega-uxdm-spatie-data-transfer-object/health.svg)](https://phpackages.com/packages/divineomega-uxdm-spatie-data-transfer-object)
```

###  Alternatives

[moderntribe/tribe-libs

A library for use on Modern Tribe service projects.

1348.8k2](/packages/moderntribe-tribe-libs)

PHPackages © 2026

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