npx skills add ...
npx skills add bagisto/agent-skills --skill bagisto-data-transfer
Use when adding or changing a Bagisto import — an Importer class, a file source, the importers registry, the queued import pipeline, or a stuck or failing import job. Trigger phrases include "import", "importer", "data transfer", "CSV", "XLSX", "XML", "bulk upload", "import batch", "queued import", "validate rows".
npx skills add bagisto/agent-skills --skill bagisto-data-transfer
packages/Webkul/DataTransfer moves bulk records into Bagisto from a file. The
package ships three importers — products, customers and tax rates —
and a queued pipeline that validates, imports, links and indexes in batches.
Import only. There is no exporter here; a DataGrid's own export handles
outbound data — see the bagisto-datagrid-development skill.
| File | Load when |
|---|---|
| importers.md | Writing or changing an Importer — the contract, validation, batches |
| pipeline.md | The state machine, queued jobs, and debugging a stuck import |
An importer is registered in Config/importers.php, merged into the top-level
importers key (not data_transfer.importers):
The admin create/edit screens iterate config('importers') directly, so a new
entry appears in the type dropdown with no view change. Import resolves the
class with config('importers.'.$type.'.importer') — the array key is the
type stored on the import record, so renaming a key orphans existing imports.
Provide all four sample paths. The UI offers a sample download per format, and a missing file is a broken link rather than a graceful fallback.
Extend Helpers\Importers\AbstractImporter and implement exactly two methods:
Everything else is declared as properties — $validColumnNames,
$masterAttributeCode, $permanentAttributes, $messages — or overridden as
hooks. See importers.md.
Helpers\Sources\ supplies CSV, XLS, XLSX and XML, all extending
AbstractSource, which is an iterator over rows plus
generateErrorReport(array $errors). An importer never opens the file itself —
it reads $this->source, so the same importer serves every format.
validateRow() must be
free of side effects: it runs over the whole file, and on
stop-on-errors the import may never reach importBatch().AbstractImporter::BATCH_SIZE is 100 and the pipeline dispatches one job per
batch. An importer that loads the file into memory defeats the design and
fails on the file sizes this feature exists for.trans() in the data_transfer:: namespace,
in all 22 locales.isLinkingRequired() / isIndexingRequired() honestly. Returning
true adds a queued stage per batch; returning false when linking is needed
leaves records half-related with no error.QUEUE_CONNECTION=sync the whole import runs inline in the request and will
time out on a real file.REQUIRED SUB-SKILL: Use bagisto-change-verification before calling any change done.`
abstract public function validateRow(array $rowData, int $rowNumber): bool;
abstract public function importBatch(ImportBatchContract $importBatchContract): bool;