PHPackages                             elaitech/import - 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. elaitech/import

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

elaitech/import
===============

Elaitech Import Package - A comprehensive import workflow system for Laravel

0.0.2(3mo ago)09MITPHPPHP ^8.4

Since Feb 16Pushed 3mo agoCompare

[ Source](https://github.com/medab123/import)[ Packagist](https://packagist.org/packages/elaitech/import)[ RSS](/packages/elaitech-import/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (28)Versions (3)Used By (0)

📦 Elaitech Import
=================

[](#-elaitech-import)

A comprehensive, modular **data import workflow engine** for Laravel 12. Provides a full pipeline system for downloading, reading, filtering, mapping, transforming, and processing data from external sources — with execution tracking, scheduling, and a built-in dashboard.

> **Namespace:** `Elaitech\Import`
> **Requires:** PHP 8.4+ · Laravel 12 · `elaitech/data-mapper`

---

📖 Table of Contents
-------------------

[](#-table-of-contents)

- [Installation](#-installation)
- [Architecture](#-architecture)
- [Pipeline System](#-pipeline-system)
- [Models](#-models)
- [Services](#-services)
- [Enums](#-enums)
- [Configuration](#-configuration)
- [Extending](#-extending)
- [Testing](#-testing)
- [License](#-license)

---

🚀 Installation
--------------

[](#-installation)

### As a local Composer package (recommended)

[](#as-a-local-composer-package-recommended)

In your root `composer.json`, add the package as a path repository:

```
{
    "repositories": [
        {
            "type": "path",
            "url": "./packages/import",
            "options": { "symlink": true }
        }
    ],
    "require": {
        "elaitech/import": "@dev"
    }
}
```

Then install:

```
composer update elaitech/import
```

### Publishing Assets

[](#publishing-assets)

```
# Publish configuration
php artisan vendor:publish --tag=import-config

# Publish migrations (optional — they auto-load)
php artisan vendor:publish --tag=import-migrations

# Run migrations
php artisan migrate
```

---

🏗 Architecture
--------------

[](#-architecture)

```
src/
├── ImportServiceProvider.php         # Package bootstrap — registers all sub-providers
├── Helpers.php                       # Global helper functions
│
├── Models/                           # Eloquent models (5)
│   ├── ImportPipeline.php            # Main pipeline definition
│   ├── ImportPipelineConfig.php      # Per-step JSON configuration
│   ├── ImportPipelineExecution.php   # Execution run records
│   ├── ImportPipelineLog.php         # Per-stage log entries
│   └── ImportPipelineTemplate.php    # Reusable pipeline templates
│
├── Contracts/                        # Top-level interfaces
│   ├── Repositories/                 # Repository contracts
│   └── Services/                     # Service contracts
│
├── Enums/                            # Backed enums (6)
│   ├── ImportPipelineStatus.php      # pending, running, completed, failed, cancelled
│   ├── ImportPipelineFrequency.php   # once, daily, weekly, monthly
│   ├── ImportPipelineStep.php        # 8 stepper steps
│   ├── PipelineStage.php            # Pipeline execution stages
│   ├── PipelineStatus.php           # active, inactive, needs_configuration
│   └── ImageDownloadMode.php        # Image download strategies
│
└── Services/
    ├── Core/                         # Shared infrastructure
    │   ├── Abstracts/                # Base abstract classes
    │   ├── Contracts/                # Shared interfaces (ServiceInterface, FactoryInterface)
    │   ├── DTOs/                     # Shared data objects (FilterConfigurationData, etc.)
    │   ├── Exceptions/               # Custom exceptions (Filter, Reader, Downloader, etc.)
    │   ├── Operators/                # Operator definitions
    │   ├── Registry/                 # Service registries
    │   ├── Cache/                    # Caching strategies
    │   ├── Configuration/            # Configuration handling
    │   └── Traits/                   # HasOptions, ServiceTrait, etc.
    │
    ├── Downloader/                   # Data source downloaders
    │   ├── Abstracts/                # AbstractDownloader base
    │   ├── Contracts/                # DownloaderInterface
    │   ├── Factories/                # DownloaderFactory
    │   └── Implementations/
    │       ├── HttpDownloader.php    # HTTP/HTTPS downloads
    │       ├── FtpDownloader.php     # FTP downloads
    │       └── SftpDownloader.php    # SFTP downloads
    │
    ├── Reader/                       # Data format readers
    │   ├── Abstracts/                # AbstractReader base
    │   ├── Contracts/                # ReaderInterface
    │   ├── Factories/                # ReaderFactory
    │   └── Implementations/
    │       ├── CsvReader.php         # CSV parsing
    │       ├── JsonReader.php        # JSON parsing
    │       ├── XmlReader.php         # XML parsing
    │       └── YamlReader.php        # YAML parsing
    │
    ├── Filter/                       # Data filtering engine
    │   ├── Abstracts/                # AbstractFilterOperator (Template Method)
    │   ├── Contracts/                # FilterInterface, OperatorRegistryInterface, etc.
    │   ├── Extractors/               # DotNotationValueExtractor
    │   ├── Registry/                 # OperatorRegistry
    │   ├── Validators/               # FilterValidator
    │   └── Implementations/          # 17 filter operators
    │
    ├── Pipeline/                     # Pipeline orchestration
    │   ├── Contracts/                # PipelineExecutionServiceInterface, etc.
    │   ├── DTOs/                     # PipelineContext, StageResult, etc.
    │   ├── Factories/                # ImportPipelineConfigFactory
    │   ├── Orchestrators/            # Pipeline orchestrator
    │   ├── Pipes/                    # 7 sequential pipes (see below)
    │   ├── Services/                 # ExecutionService, SchedulingService, TestDataService
    │   ├── ValueObjects/             # Pipeline value objects
    │   └── Implementations/          # Concrete implementations
    │
    ├── Prepare/                      # Data preparation
    │   ├── Contracts/                # PrepareInterface
    │   └── Services/                 # Preparation services
    │
    ├── ImageDownloader/              # Image download handling
    │
    ├── ImportDashboard/              # Dashboard service & repository
    │   ├── ImportDashboardService.php
    │   └── ImportPipelineRepository.php
    │
    ├── Jobs/                         # Queue jobs (2)
    │
    └── Providers/                    # Sub-service providers (5)
        ├── DownloaderServiceProvider.php
        ├── ReaderServiceProvider.php
        ├── FilterServiceProvider.php
        ├── PrepareServiceProvider.php
        └── PipelineServiceProvider.php

```

---

🔄 Pipeline System
-----------------

[](#-pipeline-system)

Each import pipeline consists of **7 sequential pipes** that process data in order:

```
┌─────────────┐    ┌──────────┐    ┌────────────┐    ┌──────────┐
│  1. Download │───▶│ 2. Read  │───▶│ 3. Filter  │───▶│  4. Map  │
└─────────────┘    └──────────┘    └────────────┘    └──────────┘
                                                          │
┌─────────────┐    ┌──────────┐    ┌────────────────┐     │
│   7. Save   │◀───│6. Prepare│◀───│5. Images Prep  │◀────┘
└─────────────┘    └──────────┘    └────────────────┘

```

### Pipes

[](#pipes)

\#PipeFileDescription1**DownloadPipe**`Pipeline/Pipes/DownloadPipe.php`Fetches raw data from HTTP, FTP, or SFTP sources2**ReadPipe**`Pipeline/Pipes/ReadPipe.php`Parses raw data using configured reader (CSV/JSON/XML/YAML)3**FilterPipe**`Pipeline/Pipes/FilterPipe.php`Applies filter rules with AND/OR logic to include/exclude rows4**MapPipe**`Pipeline/Pipes/MapPipe.php`Maps source fields → target fields via `elaitech/data-mapper`5**ImagesPreparePipe**`Pipeline/Pipes/ImagesPreparePipe.php`Processes image URLs — separators, index skipping, download modes6**PreparePipe**`Pipeline/Pipes/PreparePipe.php`Final prep — category resolution, VIN/stock ID generation7**SavePipe**`Pipeline/Pipes/SavePipe.php`Placeholder save — simulates create/update stats without persistence### Pipeline Configuration Steps (Stepper)

[](#pipeline-configuration-steps-stepper)

Pipelines are configured through an **8-step stepper wizard**:

OrderStepEnum ValueDescription1Basic Info`basic-info`Name, description, frequency, start time2Downloader Config`downloader-config`Protocol, URL, auth credentials3Reader Config`reader-config`Format, delimiter, encoding, root path4Filter Config`filter-config`Filter rules with operators and logic5Mapper Config`mapper-config`Field mappings with transformers6Images Prepare`images-prepare-config`Image handling settings7Prepare Config`prepare-config`Data preparation rules8Preview`preview`Review full configuration and test output---

📊 Models
--------

[](#-models)

### `ImportPipeline`

[](#importpipeline)

The core model representing an import pipeline definition.

FieldTypeDescription`name``string`Pipeline display name`description``string`Optional description`target_id``string`Target identifier`is_active``boolean`Whether the pipeline is enabled`frequency``ImportPipelineFrequency``once`, `daily`, `weekly`, `monthly``start_time``datetime`Scheduled start time`last_executed_at``datetime`Last execution timestamp`next_execution_at``datetime`Next scheduled execution`created_by` / `updated_by``int`Audit tracking (auto-set)**Relationships:** `config()`, `executions()`, `logs()`, `creator()`, `updater()`
**Scopes:** `active()`, `scheduled()`
**Accessors:** `status` (computed: active / inactive / needs\_configuration)

### `ImportPipelineConfig`

[](#importpipelineconfig)

Stores per-step JSON configuration. Each pipeline has multiple config entries (one per stepper step).

### `ImportPipelineExecution`

[](#importpipelineexecution)

Tracks execution runs with status, timing, and result data.

FieldTypeDescription`status``ImportPipelineStatus`pending, running, completed, failed, cancelled`started_at` / `completed_at``datetime`Timing brackets`total_rows` / `processed_rows``int`Row counts`success_rate``decimal`Percentage success`processing_time``decimal`Execution time in seconds`memory_usage``int`Memory consumed`error_message``string`Failure details`result_data``array`Detailed result payload**Helper Methods:** `markAsRunning()`, `markAsCompleted()`, `markAsFailed()`, `markAsCancelled()`, `addLog()`

### `ImportPipelineLog`

[](#importpipelinelog)

Per-stage log entries with level, message, and context.

### `ImportPipelineTemplate`

[](#importpipelinetemplate)

Reusable pipeline configuration templates for quick setup.

---

⚙️ Services
-----------

[](#️-services)

### Downloader

[](#downloader)

ImplementationProtocolKey Features`HttpDownloader`HTTP/HTTPSHeaders, auth, SSL config, timeouts`FtpDownloader`FTPPassive mode, directory listing`SftpDownloader`SFTPKey-based auth, known hosts### Reader

[](#reader)

ImplementationFormatKey Features`CsvReader`CSVDelimiter, enclosure, escape, encoding, header row`JsonReader`JSONRoot path, nested object traversal`XmlReader`XMLNode path, attribute mapping`YamlReader`YAMLRoot key extraction### Filter (17 Operators)

[](#filter-17-operators)

Built using the **Template Method pattern** via `AbstractFilterOperator`:

CategoryOperators**Equality**`equals`, `not_equals`**String**`contains`, `not_contains`, `starts_with`, `ends_with`**Numeric**`greater_than`, `less_than`, `between`, `not_between`**Set**`in`, `not_in`**Pattern**`regex`, `not_regex`**Null**`is_null`, `is_not_null`**Features:**

- Dot-notation field access for nested data
- AND/OR logical grouping of rules
- Case-sensitive/insensitive matching
- Extensible via `AbstractFilterOperator` base class

### Pipeline Services

[](#pipeline-services)

ServiceDescription`PipelineExecutionService`Orchestrates full pipeline execution`PipelineSchedulingService`Handles scheduled pipeline runs`PipelineTestDataService`Provides test data for step testing`ImportPipelineConfigFactory`Creates/updates step configurations### Dashboard Services

[](#dashboard-services)

ServiceDescription`ImportDashboardService`Business logic for the dashboard UI`ImportPipelineRepository`Data access layer for pipelines---

📋 Enums
-------

[](#-enums)

### `ImportPipelineStatus`

[](#importpipelinestatus)

`pending` · `running` · `completed` · `failed` · `cancelled`

Methods: `getLabel()`, `getDescription()`, `getColor()`, `isActive()`, `isFinished()`, `isSuccessful()`, `isFailed()`, `isCancelled()`

### `ImportPipelineFrequency`

[](#importpipelinefrequency)

`once` · `daily` · `weekly` · `monthly`

Methods: `getLabel()`, `getDescription()`, `getOptions()`

### `ImportPipelineStep`

[](#importpipelinestep)

`basic-info` · `downloader-config` · `reader-config` · `filter-config` · `mapper-config` · `images-prepare-config` · `prepare-config` · `preview`

Methods: `title()`, `description()`, `route()`, `order()`

### `PipelineStage`

[](#pipelinestage)

Represents the runtime execution stage of a pipeline.

### `PipelineStatus`

[](#pipelinestatus)

`active` · `inactive` · `needs_configuration`

### `ImageDownloadMode`

[](#imagedownloadmode)

Strategies for handling image downloads during pipeline execution.

---

⚙️ Configuration
----------------

[](#️-configuration)

The package publishes `config/import-pipelines.php`:

```
php artisan vendor:publish --tag=import-config
```

---

🔧 Extending
-----------

[](#-extending)

### Adding a Custom Downloader

[](#adding-a-custom-downloader)

1. Create a class extending the abstract downloader
2. Implement the required methods
3. Register in `DownloaderServiceProvider`

### Adding a Custom Reader

[](#adding-a-custom-reader)

1. Extend the abstract reader
2. Implement parsing logic
3. Register in `ReaderServiceProvider`

### Adding a Custom Filter Operator

[](#adding-a-custom-filter-operator)

```
use Elaitech\Import\Services\Filter\Abstracts\AbstractFilterOperator;

final class CustomOperator extends AbstractFilterOperator
{
    public function getName(): string { return 'custom'; }
    public function getLabel(): string { return 'Custom Operator'; }
    public function getDescription(): string { return 'My custom filter logic'; }
    public function supportsValueType(mixed $value): bool { return true; }

    protected function doApply(mixed $dataValue, mixed $filterValue, array $options): bool
    {
        // Your logic here
        return $dataValue === $filterValue;
    }
}
```

Register it in `FilterServiceProvider`:

```
$registry->register(new CustomOperator());
```

### Implementing Real Persistence (SavePipe)

[](#implementing-real-persistence-savepipe)

Replace the placeholder `SavePipe` with your domain-specific save logic:

```
// In your custom SavePipe:
// 1. Receive prepared data from PreparePipe
// 2. Create/update your product models
// 3. Return statistics (created, updated, errors)
```

---

🧪 Testing
---------

[](#-testing)

```
# From the package directory
./vendor/bin/phpunit

# From the root project
php artisan test
```

---

📦 Dependencies
--------------

[](#-dependencies)

PackageVersionPurpose`illuminate/support`^12.0Laravel framework support`illuminate/database`^12.0Eloquent ORM`illuminate/http`^12.0HTTP handling`illuminate/queue`^12.0Queue jobs`illuminate/console`^12.0Artisan commands`spatie/laravel-activitylog`^4.11Audit logging`spatie/laravel-data`^4.19Typed DTOs`spatie/laravel-view-models`^1.6View models`league/flysystem-ftp`^3.31FTP filesystem`league/flysystem-sftp-v3`^3.31SFTP filesystem`symfony/yaml`^7.4YAML parsing---

📄 License
---------

[](#-license)

MIT — see [LICENSE](LICENSE) for details.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance80

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

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

Total

2

Last Release

104d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/783175c2d587807f6f3d27f40a857f087f67631b74e5b902ca85e2d3ae64a9e5?d=identicon)[medab123](/maintainers/medab123)

---

Top Contributors

[![medab123](https://avatars.githubusercontent.com/u/51244814?v=4)](https://github.com/medab123 "medab123 (8 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/elaitech-import/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.4k](/packages/larastan-larastan)[flarum/core

Delightfully simple forum software.

261.4M2.2k](/packages/flarum-core)[spatie/laravel-export

Create a static site bundle from a Laravel app

670139.5k6](/packages/spatie-laravel-export)[calebdw/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

15104.9k4](/packages/calebdw-larastan)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1232.2k16](/packages/fleetbase-core-api)

PHPackages © 2026

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