Download the PHP package umutcangungormus/laravel-import-export without Composer

On this page you can find all versions of the php package umutcangungormus/laravel-import-export. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-import-export

# Laravel Import / Export **Framework-grade, tenant-agnostic CSV/XLSX import & export pipeline for Laravel.** Column auto-matching · reusable mapping templates · queued batch processing · per-row failure tracking · a publishable HTTP layer — all decoupled from your auth, tenancy, and domain models. [![Tests](https://github.com/UmutCanGungormus/laravel-import-export/actions/workflows/tests.yml/badge.svg)](https://github.com/UmutCanGungormus/laravel-import-export/actions/workflows/tests.yml) [![Packagist Version](https://img.shields.io/packagist/v/umutcangungormus/laravel-import-export.svg?style=flat-square)](https://packagist.org/packages/umutcangungormus/laravel-import-export) [![PHP Version](https://img.shields.io/packagist/php-v/umutcangungormus/laravel-import-export.svg?style=flat-square)](https://packagist.org/packages/umutcangungormus/laravel-import-export) [![Laravel](https://img.shields.io/badge/Laravel-11.x%20%7C%2012.x-FF2D20.svg?style=flat-square&logo=laravel)](https://laravel.com) [![License](https://img.shields.io/packagist/l/umutcangungormus/laravel-import-export.svg?style=flat-square)](LICENSE)

Table of Contents


Why this package

Most import/export solutions hard-wire themselves to your User model, your tenancy strategy, and your authorization stack — so they never quite leave the app they were born in. This package is the opposite: a generic engine whose every integration point is an interface you bind. Drop it into a single-tenant SaaS or a multi-tenant platform without touching its source.

It was extracted and generalized from a production multi-tenant platform, then hardened into a standalone library with a full Pest suite.

Features

Requirements

Version
PHP ^8.3
Laravel 11.x · 12.x

Installation

The service provider is auto-discovered. Publish the config, migrations, and translations as needed:

The queued batch pipeline relies on Laravel's job batching, which needs the job_batches table:

Quickstart

1. Make your model importable.

2. Describe it in config/import-export.php.

3. Run an import — programmatically, or via the HTTP API:

Progress, failures, and status are tracked on the ImportSession model throughout.

Configuration

config/import-export.php is fully documented inline. Highlights:

Key Purpose Default
disk / storage_path Where uploaded source files live local / imports
tables.* Override table names (sessions, mappings, templates, failures, users) package defaults
foreign_keys.users Toggle the bundled users FK constraint true
batch_size Rows per queued chunk job 500
job_timeout / job_tries Per-job limits 600 / 3
queue.connection / queue.queue Where jobs run (Horizon-friendly) app defaults
column_matching.auto_confirm_threshold Score ≥ this → auto-confirmed 0.8
column_matching.suggestion_threshold Score ≥ this → shown as a suggestion 0.3
templates.* Enable/limit mapping templates enabled, 50/user
tenancy.resolver Your TenantResolverContract implementation NullTenantResolver
routes.enabled / prefix / middleware Opt-in HTTP layer false / api/import-export / ['api']
gates.* Names of the authorization abilities to check namespaced strings
models The model registry (you fill this in) empty

A note on non-local disks

disk may point at any Laravel disk. When it is not a local one (S3 and S3-compatible object stores, GCS, Azure, FTP/SFTP), the reader streams the object to a tempfile for each read and removes it afterwards — CSV and XLSX parsing both need seekable local files.

That spooling happens per read, so a single import downloads the object twice while initializing (headers + row count) and once more per ProcessImportChunkJob. It is correct at any file size, but on large files served from a remote bucket the transfer cost dominates; keeping disk local (or on a mounted volume) avoids it entirely.

Tip: For large imports, point queue.connection at a dedicated connection whose retry_after exceeds job_timeout, and keep job_tries at 1 — a half-finished bulk import must never auto-retry and double-process rows.

Core concepts

The model registry

Rather than annotating models, you declare each importable model's schema once in config('import-export.models'), keyed by FQCN. Each entry defines fields (with required, type, aliases, validation, transform, default), the unique_by key for updateOrCreate, an optional processor, and export_fields. The HasImportExport trait reads this config so your models stay clean.

Multi-column targets

A field marked 'multi' => true may be fed by more than one file column at once — a spreadsheet that splits an address over Street, No and District can land in a single address column:

The mapping editor then lets the user add extra columns to that field and pick how they combine:

Strategy Result for Main St + 12 + Kadıköy
merge (default) Main St 12 Kadıköy
json {"Street":"Main St","No":"12","District":"Kadıköy"}

Cells are folded in the order the columns appear in the file. Blank cells drop out, and a row that leaves every column empty yields null — the same value an unmapped target would give, so the field's default still applies. Fields without multi are unaffected: a second column pointed at one of them is de-duplicated by confidence exactly as before, and a strategy stored against such a field is ignored.

The chosen strategy is saved on the mapping and carried by mapping templates, so a template of a combined target reapplies as one.

Processors

Domain logic — value coercion, related-record resolution, side effects — lives in a processor implementing ImportProcessorInterface:

afterComplete() is intentionally not part of the interface signature (so existing processors keep working) — FinalizeImportJob calls it via method_exists().

Tenancy

Bind a TenantResolverContract to scope every session to the active tenant:

The default NullTenantResolver returns null — perfect for single-tenant apps.

Authorization

The package never assumes an auth stack; it only references gate ability names (configurable under gates.*). Define them however you like:

Processing pipeline

Each chunk job processes batch_size rows, so jobs stay short, failures are isolated to a slice, and progress is accurate. Sessions end in Completed, CompletedWithErrors, Failed, or Cancelled.

HTTP API

Set IMPORT_EXPORT_ROUTES_ENABLED=true (or config('import-export.routes.enabled')) to register the bundled API under the configured prefix (api/import-export by default) and middleware:

Method URI Action
GET /sessions List import sessions
POST /sessions Create a session (upload file)
GET /sessions/{id} Show a session
POST /sessions/{id}/start Start processing
DELETE /sessions/{id} Cancel a session
GET /sessions/{id}/progress Poll progress
GET /sessions/{id}/failures Failure summary
GET /sessions/{id}/failures/export Download failed rows
GET /sessions/{id}/mappings List column mappings
PUT /sessions/{id}/mappings Update mappings
GET /sessions/{id}/mappings/suggestions Auto-match suggestions
GET /templates List mapping templates
POST /templates Create a template
GET PUT DELETE /templates/{id} Show / update / delete a template

Prefer your own controllers? Leave routes disabled and call the Actions / Services directly.

Exporting

Export columns, accessors, and relations come from the model's export_fields / export_with config. Default format and chunk size are configurable under export.*.

Localization

Translations ship under the import-export:: namespace (English & Turkish) across errors, export, fields, mapping, session, status, and template groups. Publish with --tag=import-export-lang to customize, and override field labels/aliases via import-export::fields.*.

Testing

The suite runs on Orchestra Testbench and covers the column matcher, file reader (CSV/XLSX/remote disk), failure handling, the full import flow, tenancy resolution, and HTTP route registration.

Frontend

A companion Vue 3 component library — drag-and-drop upload, column-mapping UI, progress, and a session manager — speaks this package's API out of the box:

➡️ @umut-can-gungormus/vue-import-export

Versioning

This package follows Semantic Versioning. See CHANGELOG.md.

License

The MIT License (MIT). See LICENSE.

Built with care by [Umut Can Gungormus](https://github.com/UmutCanGungormus).

All versions of laravel-import-export with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/contracts Version ^11.0 || ^12.0 || ^13.0
illuminate/database Version ^11.0 || ^12.0 || ^13.0
illuminate/support Version ^11.0 || ^12.0 || ^13.0
illuminate/bus Version ^11.0 || ^12.0 || ^13.0
illuminate/queue Version ^11.0 || ^12.0 || ^13.0
illuminate/http Version ^11.0 || ^12.0 || ^13.0
illuminate/pipeline Version ^11.0 || ^12.0 || ^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package umutcangungormus/laravel-import-export contains the following files

Loading the files please wait ...