承接 jord-jd/uxdm-eloquent 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jord-jd/uxdm-eloquent

最新稳定版本:v4.0.0

Composer 安装命令:

composer require jord-jd/uxdm-eloquent

包简介

Eloquent package for the UXDM data migrator

README 文档

README

Build Status Coverage Status

The UXDM Eloquent package provides a UXDM source and destination for the Eloquent ORM, commonly used in Laravel projects.

Installation

To install the UXDM Eloquent package, just run the following composer command.

composer require jord-jd/uxdm-eloquent

UXDM Eloquent Source

The UXDM Eloquent source allows you to source data from an Eloquent model. This can be handy if you need to migrate data from a system using the Eloquent ORM, such as a Laravel project.

Creating

To create a new Eloquent source, you must provide it with the class name of Eloquent model you wish to use.

The following example creates a Eloquent source object, using an Eloquent model called User in the App namespace.

$eloquentSource = new EloquentSource(\App\User::class);

You can also pass a query callback as a second parameter to restrict the results returned, as shown below.

$eloquentSource = new EloquentSource(\App\User::class, function($query) {
    $query->where('id', 1);
});

Assigning to migrator

To use the Eloquent 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($eloquentSource);

UXDM Eloquent Destination

The UXDM Eloquent destination allows you to migrate data into an Eloquent model. This can be handy if you need to migrate data into a system using the Eloquent ORM, such as a Laravel project.

Creating

To create a new Eloquent destination, you must provide it with the class name of Eloquent model you wish to use.

The following example creates a Eloquent destination object, using an Eloquent model called User in the App namespace.

$eloquentDestination = new EloquentDestination(\App\User::class);

Assigning to migrator

To use the Eloquent 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($eloquentDestination);

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($eloquentDestination, ['field1', 'field2']);
$migrator->addDestination($otherDestination, ['field3', 'field2']);

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-only
  • 更新时间: 2026-02-14