Importer
Overview
The GXP Importer is a multi-stage, strategy-driven import pipeline that processes data from spreadsheet uploads, clipboard input, and third-party integrations (Cvent, Swoogo, Legacy EventFinity and, at the reviewed develop checkpoint, Google RSVP). Data passes through source-dependent metadata, validation, review, write and cleanup stages. The stage vocabulary below includes completion; not every source or review mode follows the same path. The system uses Laravel's job batching to process data in configurable chunks, supports automatic (unattended) and manual (review-required) workflows, and supplies integration origin markers that compatible downstream consumers can use to suppress sync-back.
Supported import types are registered in Import::importTypes():
public static function importTypes()
{
return [
'attendee' => 'App\Models\Attendee',
'group' => 'App\Models\Group',
'credential' => 'App\Models\AttendeeCredential',
'credential_type' => 'App\Models\AttendeeCredentialType',
'attendee_field' => 'App\Models\AttendeeField',
'attendee_type' => 'App\Models\AttendeeType',
'agenda_item' => 'App\Models\AgendaItem',
'location' => 'App\Models\ProjectLocation',
'saved_search' => 'App\Models\SavedSearch',
'collection_entry' => 'App\Models\CollectionEntry',
'project_tag' => 'App\Models\ProjectTag',
];
}
Create and review an import
On the dashboard host, open /p/{team}/{project}/imports and use Create Import (the dedicated form is /p/{team}/{project}/imports/create). Select a returned row or Review to inspect that import. The list also offers expandable settings; changing those settings is separate from approving the staged data. Keep the project and import ID with your results so that a later review or retry does not accidentally target another run. The system-wide import monitor is a separate operator surface.
Choose the intended project, import type and source before supplying data. A type appearing in the registry does not mean it supports every source method. Location and collection-entry imports accept file or copy-and-paste input; the create request rejects integration methods for those types.
File and copy-and-paste imports require an import key. Choose a supported matching key deliberately and inspect whether rows will create records or update existing ones. Copy-and-paste input also requires raw data. Collection-entry imports require a collection in the current project that has not been deleted. Templates are offered only for types whose model declares template support; do not assume every registry entry has a downloadable template.
The dashboard create controller defaults to review required and automatic processing disabled. Review the mapping, matching keys, validation errors and proposed changes before approving a manual import. Creating or approving an import is separate from completing its queued work.
At develop 25e1564 (reviewed 2026-10-19), source selection also narrows the offered import types to that provider's configured list. Google RSVP offers attendees and takes its event from a verified team connection; see Google RSVP connection and import setup. A missing type/source choice is not proof a record was deleted or that changing the URL enables a supported import. Confirm the selected method, configured type support and server validation.
Prepare a spreadsheet or template
The file create request accepts CSV/Excel MIME types for CSV, XLS and XLSX inputs. Keep column headers on the first row. The spreadsheet service reads the loader's active worksheet; it does not combine workbook sheets. In the tested XLSX loader configuration, a workbook saved with its second sheet selected still imported the first sheet. Do not rely on the sheet selected in your desktop editor: upload a single-sheet workbook or export the intended sheet as CSV. Use unique, nonempty header names.
Where supported, downloading a template requires create-import authorization and returns {type}-import-template.csv with column slugs as headers plus one model-provided sample row. Replace or remove the sample before importing your real data. Unsupported or unknown template types return 404; this does not mean the underlying import type is necessarily unavailable.
Review the automatic column mapping against the intended fields. A downloaded template is a starting shape, not a populated project export or proof that its sample values are appropriate for your project. Confirm the matching key, required fields and project-specific references before approval.
Prepare copy-and-paste input
Paste a header row followed by data rows. Spreadsheet tabs take priority when a tab appears in the first nonempty line. Otherwise, the parser chooses among comma, semicolon and pipe using recognized column names and matching-key spellings before column count. This is a heuristic: inspect the parsed headers and mapping before approval, especially when a header itself contains punctuation.
Cells are trimmed. A leading UTF-8 byte-order mark is removed. Truly empty lines are dropped, including a trailing newline; delimiter-only lines remain as rows and may need omission during review. Put the header on the first retained line and use unique, nonempty names. Blank headers are removed together with their column positions; missing values become empty strings and values beyond the header positions are discarded. Duplicate header names cannot represent separate values safely.
Tab-separated cells retain literal quote characters. Comma/semicolon/pipe parsing handles quoted delimiter characters within a single line. Quoted multiline cells and quote decoding for single-column CSV are outside this paste parser's contract; upload a file for those inputs. Paste parsing does not scan all data rows to prove that the selected delimiter is consistent.
Chunk boundary limitation: the reviewed paste strategy passes endRow directly as the length to array_slice, while the default retrieval layer calculates it as an end boundary. For example, getImportData(2, 4) returns four rows numbered 2–5, rather than only rows 2–3. Larger inputs can therefore produce overlapping chunk selections. This has been reproduced with synthetic records; it does not establish the eventual effect of a full parallel import. For large pasted datasets, use a file upload and verify results. Do not infer universal exactly-once behavior from the first-chunk parser tests.
Worked example: review two location changes
Use a disposable project for this exercise. The example assumes a location named Demo Existing Hall already exists in that project with description Before review, and no location named Demo New Hall exists. Location matching accepts name, slug or id; this example deliberately matches by name.
- Start a location import in the intended project using copy-and-paste, with
nameas the matching key. Set review required and leave automatic processing disabled. - Paste the following small CSV, including the header:
name,description
Demo Existing Hall,Updated after review
Demo New Hall,Created after review
- Inspect parsed headers and mapping. They should be
nameanddescription, with two source rows. Preserve the exact names for this exercise: a changed name with name-based matching can select a create instead of updating the intended location. - Wait for review staging. With the stated preconditions, expect one
updaterow and onecreaterow with no field validation errors. Before approval, the existing description should remainBefore reviewand the new location should not exist. If the preview differs, stop and correct the source, key or mapping rather than approving an unexpected operation. - Approve the import with a principal permitted to manage it. Approval queues the write stage. Inspect row results after processing rather than treating the approval response as completion.
- Verify that the original location now has description
Updated after review, thatDemo New Hallhas descriptionCreated after review, and that both row results aresuccess. The new location gets a generated slug; the existing location's identity remains the one selected by the matching key. Inspect any errors and reconcile written records before a new retry.
A retained synthetic test exercises this exact data through the real paste parser, validation, intermediate review storage, staged-row reconstruction and write layer: 1 test/13 assertions. It confirms the staging-versus-write boundary and expected records. The test invokes those layers directly; it does not prove browser controls, approval HTTP authorization, queue workers or live-project behavior. Use the permission and lifecycle sections below when running the full dashboard flow.
Access and review decisions
For standard dashboard admin authorization, ImportPolicy inherits the configured resource mapping:
| Task | Policy action | Permission key |
|---|---|---|
| List/view imports and view review statistics | viewAny / view | view_imports |
| Create an import or download a supported template | create | create_imports |
| Update settings, approve, decline, reactivate, reset, cancel or retry | update | manage_imports |
| Delete an import record | delete | manage_imports |
The shared dashboard policy checks admin permissions in the route's project and current-team context. These are permission keys, not promises that a particular role has them. Confirm grants for the intended project/team and distinguish viewing from managing. Other authenticated principal/token types have separate policy paths; a portal, reader or plugin credential is not automatically equivalent to a dashboard admin permission.
The dashboard controller applies Import resource authorization. Approve, decline, reactivate, reset, cancel and retry additionally require update authorization and matching project identity. A visible review button does not establish that the server will permit the action.
Approval of an already approved import returns its existing state. A conflicting active run can return 409 rather than starting another run; inspect current progress before retrying. Other approval failures can return a message/error in a JSON response, so successful HTTP transport alone is not proof that approval or record processing succeeded.
Decline records the review decision and reviewer. Reactivation is accepted only for declined imports. Cancel, reset and retry call distinct orchestration operations; do not treat them as interchangeable ways to undo committed records. Preserve the import ID and inspect actual changes before selecting a recovery action.
Pipeline Stages & Status Lifecycle
Pipeline Stages
The model defines the following stage vocabulary on pipeline_stage. This is not a guarantee that every run visits every stage:
| Order | Stage Constant | Value | Description |
|---|---|---|---|
| 1 | $STAGE_PRE_IMPORT | pre_import | Metadata extraction and column validation |
| 2 | $STAGE_DATA_RETRIEVAL | data_retrieval | Fetch row data from strategy source or EAV storage |
| 3 | $STAGE_VALIDATION | validation | Per-cell validation against import config rules |
| 4 | $STAGE_EAV_DATA_STORAGE | eav_data_storage | Store validated cells as ImportCell records |
| 5 | $STAGE_REVIEW | review | Awaiting user review and approval |
| 6 | $STAGE_REVISION_PROCESSING | revision_processing | Re-processing after user edits columns/keys |
| 7 | $STAGE_IMPORT | import | Creating/updating records in the live dataset |
| 8 | $STAGE_CLEANUP | cleanup | Cache clearing, group refresh |
| 9 | $STAGE_COMPLETE | complete | Import finished |
Status Values
| Status Constant | Value | Meaning |
|---|---|---|
$STATUS_PREPARING | preparing | Extracting metadata |
$STATUS_PROCESSING | processing | Running validation and EAV storage |
$STATUS_REVIEW | reviewing | Waiting for user to review/approve |
$STATUS_UPDATING | updating | Processing user revisions |
$STATUS_IMPORTING | importing | Writing records to database |
$STATUS_IMPORT_SUCCESSFUL | import_successful | Stage settled successfully; inspect row errors and counts before concluding every row changed |
$STATUS_IMPORT_FAILED | import_failed | Import stage encountered fatal errors |
$STATUS_FAILED | failed | Pre-import or metadata stage failure |
$STATUS_COMPLETE | complete | Defined completion value; not written by the reviewed post-import path |
$STATUS_CLEANING_UP | cleaning_up | Running cleanup and notifications |
$STATUS_CANCELLED | cancelled | User cancelled the import |
The reviewed PostImportJob, CleanupLayer and NotificationLayer do not write complete. Cleanup clears the automated-import cache and notification dispatches ImportComplete; an event does not prove the current run has transitioned to complete, especially when a newer run has already been claimed.
Review Statuses
| Constant | Value |
|---|---|
$REVIEW_STATUS_APPROVED | approved |
$REVIEW_STATUS_DECLINED | declined |
Manual review versus inline processing
The pre-import worker writes validated rows inline when auto_processing_enabled is true or requires_review is false. It stages rows for manual review only when automatic processing is false and review is required. Setting review required alone does not preserve a review gate if automatic processing is enabled.
For a nonempty, successfully settled batch, the manual path moves to reviewing; the inline path moves to import successful and dispatches post-import work. Row-level errors can still be recorded during chunk processing, so inspect the error list and resulting records rather than equating a successful stage with every source row being written.
A valid source with zero rows takes an early no-data path: it marks import successful in the pre-import stage and removes its supported attendee working snapshot. That path returns before batch settlement and its post-import dispatch. Distinguish this result from an import that wrote records and completed cleanup/notification work.
Approval and import settlement
Approval claims a new run, records the approver and review decision, and dispatches ImportJob. The parent sets importing/import stage when it executes; approval's request completing does not mean target writes have finished. Import chunks read the staged EAV rows, validate them again and write accepted records. Rows already recorded as imported can be skipped on worker retry, while post-import work for those rows may still be needed.
The approved-import parent freezes its chunk size for the dispatched chunks. The model's import configuration can provide a value or closure for chunk_size; otherwise the importer default is used. This path is distinct from the initial source strategy's range calculation.
An approved import with no chunks settles directly as import successful and dispatches post-import work, avoiding an empty batch that would never invoke its callbacks. This differs from the zero-row pre-import early return described above, which does not dispatch that post-import path.
For a nonempty import batch, a cancelled settlement callback does not mark success. Success and failure transitions require the original run token still to own the import; failure records import failed and dispatches ImportFailed. Successful settlement promotes the integration cursor and dispatches PostImportJob. Inspect row results and side effects as well as the batch status: neither approval nor successful settlement guarantees that every source row changed.
Lifecycle Flow
Manual Import (requires_review = true AND auto_processing_enabled = false):
initializeImport()
|
v
[preparing / pre_import]
|
v
PreImportProcessingJob
|-- MetadataProcessingLayer (extract headers, row count)
|-- Dispatch ChunkedPreImportProcessingJob batch
| |-- DataRetrievalLayer (fetch from strategy)
| |-- ValidationLayer (validate cells, determine create/update)
| |-- IntermediateCellStorageLayer (store as ImportCell/ImportRow)
v
[reviewing / review] <--- User reviews data in UI
|
|--- reviseImport() ---> RevisionProcessingJob ---> loops back to PreImportProcessingJob
|
|--- approveImport()
v
[importing / import]
|
v
ImportJob
|-- Dispatch ChunkedImportJob batch
| |-- DataRetrievalLayer (read from EAV storage)
| |-- ValidationLayer (re-validate)
| |-- ImportLayer (create/update records)
v
[import_successful / import]
|
v
PostImportJob
|-- CleanupLayer (clear caches)
|-- NotificationLayer (dispatch ImportComplete event)
v
Done
Auto-Processing Import (requires_review = false OR auto_processing_enabled = true):
initializeImport()
|
v
PreImportProcessingJob
|-- MetadataProcessingLayer
|-- Dispatch ChunkedPreImportProcessingJob batch
| |-- DataRetrievalLayer
| |-- ValidationLayer
| |-- ImportLayer (skips EAV storage, imports directly)
v
[import_successful / import]
|
v
PostImportJob --> Done
Restricted system import monitor
System Imports at /system/imports spans projects for authorized platform administrators; it is separate from a project's import creation/review workflow. It inherits system-host super-admin, two-factor, authenticated/verified account, team-context and password-confirmation gates, and the controller registers Import resource authorization. Without a bound project, the index and deletion path additionally require a super administrator. These source checks do not establish every deployed binding, ordinary-account or cross-project refusal.
Locate the import and owning project
Use Team, Project, Name, Import Type/Method, Status and automatic-processing information to identify the import. Retain its numeric ID and actual team/project slugs, especially when names repeat. The global index joins projects and teams and loads the owner; it defaults to Updated descending and ten rows per page. A paginated/joined list is not an exhaustive historical inventory. The page config has a search route, but the reviewed controller index does not apply a text-search condition; do not assume entering text narrowed the returned population. Verify returned identities before editing.
The system route registers index, update and destroy only. Its page does not enable the commented-out integration/create dialog, so create imports through the intended project's Create Import flow described above. Do not infer a supported global create or approval endpoint from additional methods present in the shared controller.
Inspect and revise import settings
Expand the row to inspect Import Name, Auto Processing Enabled, Auto Processing Interval (minutes), Only Process New Records After This Time, conditional Requires Review, attendee-only Quiet Group Placement and read-only Last Run At. The global page converts stored seconds to rounded display minutes and converts a submitted interval back to seconds. Update validation requires at least 300 seconds; use at least five minutes in this UI and seconds in an integration. A formatted interval is eligibility configuration, not a promise that a worker runs or completes on that cadence.
Before changing a watermark, automatic mode or review behavior, retain its previous saved values and intended next-run population. Clearing a watermark can broaden later source processing; changing settings is separate from approving staged data or undoing prior target writes. Requires Review is hidden when auto processing is enabled, which does not prove every source/mode follows the same review pipeline. Use the lifecycle and scheduling sections below, including Cvent's separate agenda sync and quiet-placement limits.
Follow review and understand revision effects
The row's View action opens the project import detail using the row's owning team/project and import ID. Verify those identities after navigation; the global page's current team is not a substitute for the import's project. Inspect the current run token/stage, review population, errors and committed changes before invoking project workflow actions. Opening the owning detail is not approval or a retry.
The system update handler refuses a change while recorded batch IDs are running. Its orchestrator revises ordinary settings in place; supplying remapped column headers or an import key takes the claimed revision/reprocessing path, clears review attribution/state and dispatches revision work. Those are not interchangeable metadata-only saves. The global expandable fields do not expose every revision parameter accepted by integrations. A successful response or returned row is not proof revision processing, target writes or completion work finished.
Recover uncertain updates and retire records
For an absent import, check page/sort, exact IDs and joined project/team availability before creating a duplicate. For a refused update, inspect the existing run and recorded batches rather than changing settings through another route. For an uncertain response, reload the same import and compare saved values, stage/run and target effects before retrying. Disabling automatic processing is a scheduling change, not proof an already dispatched run stopped. Use the documented cancellation/run-ownership path and private worker reconciliation when active work needs intervention.
The global Delete control calls model deletion; the reviewed handler does not explicitly cancel recorded batches first. The model does not declare soft deletion, and at develop 25e1564 the observed deletion hook invokes raw attendee-snapshot cleanup for Cvent and Google RSVP. That is not proof all staging/uploads/jobs were removed, imported target data was rolled back, external records changed or a Restore control exists. Preserve the original source, IDs and required outcomes, reconcile active work through the authorized owner, and use private retirement/recovery procedures before any approved deletion. Do not delete an import to clear a running status or use another import run as a status probe.
Run ownership and interrupted work
A new run is claimed under a per-import lock after reloading current state from the primary database. It receives a new run token and preparing status before setup/dispatch. A second start, retry, reset or approval can be refused while that run is active. Caller settings are applied after the claim succeeds; a rejected start is not an opportunity to change the active run's settings.
The in-progress guard considers preparing, processing and importing states, plus unsettled recorded batches. It does not unlock a run merely because it is old. Recently cancelled batches can continue to block another run for a configured job allowance, so cancellation is not a promise of immediate safe restart.
Cancellation rotates the token and cancels recorded batches; it does not undo records already written. Review rows are retained for later cleanup, while the supported raw attendee working snapshot is removed. Cleanup is conditional on current run ownership so a superseded setup does not delete a newer run's rows, cells or errors. Preserve the import ID and inspect committed changes before retrying. Detailed worker reconciliation procedures remain in private operational documentation.
Old jobs and completion work
Parent and batch-settlement writes use the captured run identity so a superseded run cannot overwrite the newer run's metadata or mark it failed. If cancellation lands while a parent is dispatching a batch, the ownership check can cancel that batch instead of recording it as current work. Inspect the current run and its batch IDs when diagnosing delayed jobs.
Post-import work has a different boundary: it belongs to a run that already settled successfully. A newer run starting does not erase that prior run's cleanup, notification or workflow obligations. The reviewed completion job can therefore execute after the token has changed, while merging pending automation settings from the live row without overwriting the newer run's identity/status. A delayed completion signal may refer to earlier work; it is not proof that the currently preparing run has finished.
Automatic scheduling and staging retention
The reviewed scheduler invokes the automatic-import command every minute. Its scan selects enabled imports with a positive interval whose last run is absent or old enough, then delegates to the orchestrator's run claims. This is an eligibility scan, not a promise that workers start or complete an import every minute. The dashboard update rules require an interval of at least 300 seconds.
Cvent agenda-item imports are excluded from that scan because their session-sync job drives the bidirectional cycle. Verify the relevant integration job when diagnosing those imports rather than assuming the generic automatic-import scan owns them. The ProcessAutomaticImportsJob class is a placeholder; its empty handler is not the scheduler implementation.
Daily staging cleanup selects imports whose updated_at is more than one day old and removes associated cells, rows, job errors and raw input data. It does not delete the primary Import row or the imported target records, and its selection is not limited to successful imports. A retained import record therefore does not guarantee its old preview/error/raw data is still available.
Keep the original source available when a review or recovery may happen later. If staging has been removed, confirm which source data remains and regenerate the supported review path before approval; do not assume copy-and-paste raw input can always be recovered from the import record. Actual scheduling and queue/storage operation must be verified in the target environment.
Chunk redelivery versus a new retry run
An interrupted worker delivery is different from the dashboard Retry action. Dashboard retry claims a new run and rebuilds staging; chunk redelivery continues within its existing run identity and ownership guards.
For inline file/copy-and-paste processing, row numbers are stable and the chunk uses recorded row results to skip already imported rows. The tested file path resumes after an interrupted attachment download without duplicating the synthetic collection entries. This is a row-checkpoint guarantee for that path, not a promise that every external effect is exactly once.
Remote pages can move between fetches, so row offsets are not treated as the same stable checkpoint identity. The reviewed Eventfinity chunk replays its population and uses configured matching keys to update the same records. Verify matching keys and provider identifiers before relying on replay to avoid duplicates. A remote fetch failure must fail the chunk rather than masquerade as an empty successful page.
Processing Layers
All layers extend BaseImportLayer, which holds a reference to the Import model:
class BaseImportLayer
{
private Import $import;
public function __construct(Import $import)
{
$this->import = $import;
}
public function getImport(): Import
{
return $this->import;
}
}
1. MetadataProcessingLayer
Stage: pre_import
File: app/Services/Importer/Layers/MetadataProcessingLayer.php
Extracts metadata (row count, column headers) using the selected import strategy and validates headers via ColumnHeaderValidator. Exceptions inside the metadata extraction/validation block are wrapped as a service-connection error; strategy-factory construction occurs before that block.
Key behavior:
- Creates strategy via
ImportStrategyFactory - Calls
strategy->getMetadata($import)to get aStrategyMetadataDTO - Filters out empty/null column headers
- Assigns
column_headers,row_countand optional remaps on the in-memory Import; the owning pre-import job persists them conditionally - Returns
ImportResponseDTOwith validity status
Manual pairing for check-in and printing fields
At develop commit 25e1564 (reviewed 2026-10-19), attendee import configuration marks checked_in, checked_in_at and print_status for deliberate manual pairing. Fresh automatic mappings to these destinations are set to [OMIT], including matching source names and provider presets. For fresh automatic mappings, this prevents a routine source refresh from automatically replacing locally managed check-in/printing state. Confirm deployed availability before relying on it.
Inspect the review table and pair one of these destinations explicitly only when the intended import should update that state. Check a sample row's resulting value and target record after approval. Existing saved pairings are preserved when metadata is refreshed; a retry is not a reset of an administrator's earlier choice. Inspect persisted mappings before rerunning an old import.
The metadata layer applies this filter to newly generated pairings, not as a universal write prohibition. An internal auto_pair_all_columns opt-out exists for workflows such as rollback. It is not a reason to assume every import will omit these fields. Creation, metadata and reset paths have separate handling; inspect the actual source method and saved mappings. Google RSVP's source check-in timestamp is likewise not an automatic guarantee of a local check-in write.
2. DataRetrievalLayer
Stage: data_retrieval
File: app/Services/Importer/Layers/DataRetrievalLayer.php
On the initial pass (pre_import stage), fetches data from the strategy source by calling strategy->getImportData(startRow, endRow). On subsequent stages (e.g., after review), reads from the EAV cell storage instead using EAVDataToRowDTO to reconstruct RowDTO objects from ImportCell records.
Key behavior:
- Uses default row boundaries for initial source retrieval; approved staged retrieval can use its dispatch-frozen chunk size
- Strategy may override
getJobStartRow()andgetJobEndRow()for custom chunking - Falls back to EAV data when
pipeline_stageis pastpre_import
3. ValidationLayer
Stage: validation
File: app/Services/Importer/Layers/ValidationLayer.php
Validates each cell against the import config rules. Determines whether each row is a CREATE or UPDATE operation by checking the import key against existing records via uniqueItemsByImportKeyQuery(). Uses ColumnRemapper to translate incoming column names to model field names. Casts values using FieldCaster before validation.
Key behavior:
- Accepts an array of
RowDTOobjects, yieldsValidatedRowDTOobjects via a Generator - Uses separate
create_ruleandupdate_rulefrom column config - Checks a model create limit against its observed existing count during validation; this check is not a reservation for concurrent or later creates
- Looks up existing records by the cast/remapped import key. The current unique-lock helper returns true, so this layer does not guarantee duplicate-key rejection within the input
- Runs Laravel's
Validator::make()with the active rule set
The separate RowValidator class is empty. LimitCheckValidator::validate() reads a model's create limit but returns an empty error collection without enforcing it; the reviewed app search found no active callers of either helper. Use the actual ValidationLayer behavior described here rather than treating these class names as additional safeguards. The older EAVDataToValidatedRowDTO helper also has no app callers in the reviewed search; current staged retrieval uses row DTO reconstruction followed by validation.
Matching-key and validation troubleshooting
A matching existing record selects update rules; otherwise the row uses create rules. Matching is delegated to the target model's import-key query, so its project/resource scope and supported key matter. Confirm the previewed create/update decisions before approving a file intended only to update existing records.
A missing key produces a validation error unless the type's import configuration allows create-without-key. Even with that setting, the selected import key must be a recognized column for the type; it is only its presence in the source header that can be optional. That exception permits an unmatched create path; it does not supply an existing-record identity. Deduplicate input keys before importing and inspect repeated keys explicitly: the validation layer's current lock hook does not reject them.
Column remapping happens before casting and rule selection. Unknown configured columns or casting failures are recorded as row errors. Relation and transform columns use their configured handlers rather than the default field cast. Correct the mapping and source values, then revalidate; do not infer valid writes merely from successful source retrieval or an aggregate stage status.
4. IntermediateCellStorageLayer
Stage: eav_data_storage
File: app/Services/Importer/Layers/IntermediateCellStorageLayer.php
Stores validated cells as ImportCell records and row metadata as ImportRow records for user review. Uses bulk upserts for performance. The pre-import chunk path uses this storage only when review is required and automatic processing is disabled.
Key behavior:
- Calculates an upsert batch size from the first row width, four values per cell and a 5,000-value budget; this is a batching calculation, not a measured performance guarantee
- Upserts cells on
(import_id, column_name, row_number)uniqueness - Upserts rows on
(import_id, row_number)uniqueness - Sets
operationtocreate,update, oromitbased on validation results
Staged arrays are JSON-encoded; booleans become the strings 1 and 0 so false survives review and later boolean casting. Other values are string-cast, including null becoming an empty string. When staged cells are reconstructed, the row DTO retains those stored values and validation casts them again. Staging is therefore not a lossless preservation of every original PHP value.
Any collected row validation error makes the staged operation omit; otherwise existing-model presence selects update versus create. The storage transaction upserts current values and validation/operation metadata. It does not write target records. Custom callers should provide rows with real column values: the batch calculation uses the first row width, and an empty-width row is not a supported zero-column input.
5. RevisionLayer
Stage: revision_processing
File: app/Services/Importer/Layers/RevisionLayer.php
RevisionLayer::execute() is empty. The separate ChunkedRevisionProcessingJob::processRevisions() is also empty; neither applies cell edits. The dashboard update rules accept mapping and matching-key changes, but do not accept data_revisions.
reviseImport() starts a claimed run when its parameter set includes remapped headers, the import key or data revisions. It clears staging/errors and review state, writes the settings and dispatches RevisionProcessingJob. This is triggered by the supplied field names, not a comparison proving that their values changed. Other accepted settings are updated without entering that revision path.
The revision parent records processing/revision stage, dispatches placeholder chunk jobs, then returns to pre-import processing after an uncancelled batch settles and its run still owns the import. With no chunks, it dispatches pre-import directly. A failed revision batch marks its owned run failed; cancelled or superseded runs do not continue through the settlement callback.
Treat this as a mapping/key revalidation path, not a cell-edit implementation. To correct source values, update the source input and create or restart an appropriate import after reconciling any existing writes. A saved data_revisions value alone does not prove those values will be applied to rows.
6. ImportLayer
Stage: import
File: app/Services/Importer/Layers/ImportLayer.php
Creates or updates accepted rows in the write path, either after manual approval or inline when review is bypassed. Handles multiple column types:
- Regular columns: Direct model field assignment with type casting
- JSONB columns: Merged into existing JSONB attributes (e.g.,
attendee_fields) - Relation columns: Processed via configurable
handleclosures - Transform columns: Processed via configurable
transformclosures - Attachment columns: Records remote URLs for deferred
ImportAttachmentsJobwork after the row write; the attachment worker downloads and attaches compatible files
Key behavior:
- Wraps each row in a database transaction
- Sets a mapped
sourceIntegrationmarker when the model declares the property; downstream suppression depends on compatible consumers - Applies
defaultclosures from column config for new records - Tracks created/updated IDs per chunk for post-import processing
- Persists row results (success/failed/skipped) via bulk upsert
- Runs
PostImportStrategyFactoryper chunk after all rows processed
Deferred attachment outcomes
Record writes and attachment writes are separate steps. The chunk adds deferred attachment work to its existing batch when available; without a batch it dispatches the attachment job separately. Do not interpret a row's successful write as proof that its remote file has arrived.
A remote file that cannot be fetched can be skipped, as can a column without a compatible file definition. Failure to write a downloaded file to temporary/final storage, a refused attachFile() result, or failure to record required sync bookkeeping instead fails the attachment job so retry can recover it. Inspect attachment errors and the final asset before relying on a successful aggregate status.
The file helper uses the remote URL's basename to skip a filename already present on the model. This is not a content checksum; changed remote bytes under the same filename are not proven to have been fetched. Blank attachment values do not request a generic clear operation.
Attachment changes use their own sync recording and attendee webhook dispatch. At reviewed develop revision 98dfe0fa8d92ca382c4a460c84b347637c141768, the worker tracks whether any attachment write changed attendee webhook columns and relies on the observer path in that case; it manually announces the photo only when the observer has not already handled such a change. A moderation reset can change attendee fields and invoke that observer path. This suppresses that duplicate manual announcement, not every possible repeated delivery. Retry reconstruction can still announce again, and a successful local dispatch does not prove external receipt. Tests cover retry reconstruction of these records, but that does not prove external sync or webhook receipt. The attachment job declares encrypted queue payloads because its URL list can contain signed file links.
Remote file troubleshooting
The downloader accepts HTTP/HTTPS URLs with a resolvable host, validates the resolved addresses, and checks each redirect target separately. Private/reserved addresses and unsupported schemes are refused. It permits up to three redirects, uses a ten-second connection timeout and a sixty-second request timeout, and caps downloaded bytes with filesystems.large_upload_threshold (20 MiB by default, configurable).
| Symptom | What to check |
|---|---|
| URL rejected before download | Supply an HTTP/HTTPS file URL whose host resolves to allowed public addresses. A local file path or private service URL is not this import source. |
| Remote HTTP error | Check file availability and signed-link expiry; a link usable during setup may expire before its queued job runs. |
| Too many redirects | Use the final supported file URL or resolve the redirect chain; the downloader does not follow unlimited redirects. |
| File exceeds limit | Compare the actual file size with the deployment's configured byte cap. |
| File extension/type refused | Match the target field's accepted extensions. Extensionless files need a detected MIME type that can be mapped to an accepted extension. |
| Row present but asset missing | Inspect skipped fetches, field file definitions and attachment-job errors separately from the row result. |
The downloader sanitizes filenames and detects MIME from downloaded bytes. Detection and an accepted filename extension do not replace the target field's file rules or establish that every remote service is reachable from the worker. Verify the resulting stored asset in the target environment.
Provided, omitted and unchanged values
The generic update path assigns provided regular values and merges provided JSON keys into the existing JSON attribute. An accepted null can therefore be assigned to a provided field, while unrelated JSON keys remain present. Omitting a column is different from supplying a blank value. Relation, transform and attachment columns use their configured handlers and should be tested for the intended clearing behavior.
Rows with validation errors are recorded as skipped/omit before record writes. Update/create exceptions produce failed row results and row errors; successful rows can remain committed even when other rows fail. Inspect per-row results rather than interpreting the entire input as one atomic transaction.
For new records, configured default closures run when the mapped value is empty. Zero or false can satisfy that test, so review defaults when those are meaningful supplied values.
The tested ordinary attendee re-import path preserves unchanged records' timestamps and adds no attendee audits when the same rows are imported again. That check does not establish that every relation, attachment or external consumer has no effects on a repeat run. A recorded successful update result can describe processing an unchanged row; use actual change/audit evidence when deciding whether data changed.
7. CleanupLayer
Stage: cleanup
File: app/Services/Importer/Layers/CleanupLayer.php
CleanupLayer::execute() clears the automated-import cache. Its separate refreshDynamicGroups() method queues a refresh action per dynamic project group; the post-import job invokes that method separately. Queued refresh dispatch does not prove group membership has already been recalculated.
8. NotificationLayer
File: app/Services/Importer/Layers/NotificationLayer.php
Dispatches ImportComplete. This layer does not itself send a user notification or verify delivery; inspect the configured consumers and resulting effects:
public function execute()
{
ImportComplete::dispatch($this->getImport());
}
Run-level completion work
Per-chunk post-import strategies and PostImportJob serve different purposes. The completion job first merges pending automatic-processing settings into the live import under a row lock, then clears the automatic-import cache. For attendee imports it also attempts dynamic-group refresh, recalculates leaderboards whose segment fields intersect imported headers/remaps, clears relevant attendee-name caches and records created-attendee lifecycle analytics from successful created-row results. These operations do not stand in for each individual attendee's normal event chain.
The lifecycle analytics pass stores an import-row cursor and a completion marker keyed by the completion job's identity. It catches and logs individual recording failures and can advance beyond those rows; the marker is not proof that every expected analytics record was stored. Likewise, dispatching group refresh does not prove membership has already changed.
Next the notification layer dispatches ImportComplete, the import status broadcast contract. The completion job separately attempts the aggregate workflow event ImportCompleted. For a registered manifest entity type, it streams successful import rows with target IDs into a manifest, retaining operation and source-integration provenance. Manifest identity uses the job's stable key and the source cursor describes the end of the row stream; the event does not embed every target ID. An empty manifest produces no aggregate trigger.
The manifest records trigger intent and is dispatched through BatchTriggerOutbox; pending-trigger recovery is a separate platform mechanism. Aggregate dispatch exceptions are logged without changing the already successful import to failed. The completion job's permanent failure handler also logs rather than marking the import failed. Inspect workflow execution/manifest evidence when automation is required: ImportComplete, a successful import status and an aggregate workflow completing are three separate observations.
See Event system for event registration and asynchronous outcome boundaries. Detailed recovery procedures remain in operator runbooks.
Import Orchestrator
File: app/Services/Importer/ImportOrchestrator.php
The orchestrator is the primary API for controlling import lifecycle. All methods accept an Import model instance.
| Method | Purpose |
|---|---|
initializeImport(Import $import) | Claims a run as preparing, cleans staging data under that claim, clears pipeline stage/column errors and dispatches PreImportProcessingJob |
reviseImport(Import $import, array $revisionParams) | Supplied mapping/key/revision fields trigger a claimed run, staging/error cleanup and RevisionProcessingJob; this does not implement cell-edit application |
resetImport(Import $import) | Claims a new run; clears EAV staging, errors, review state, data_revisions and remapped_column_headers. Does not undo target records. Re-applies Legacy EF remapped columns from config if applicable. Dispatches PreImportProcessingJob |
retryImport(Import $import) | Claims a run, cleans staging data/errors, clears review state and restarts pre-import processing; unlike reset, does not clear data revisions/remapped headers |
approveImport(Import $import, $approver) | Sets review status to approved, associates the reviewer, dispatches ImportJob |
cancelImport(Import $import) | Cancels recorded batches, rotates the run token, marks cancelled and clears review state; staging rows remain for the next run, while the supported attendee working snapshot is removed |
reactivateImport(Import $import) | Clears review state and errors, preserves import data (rows, cells, column headers, data revisions), dispatches PreImportProcessingJob to re-run validation |
rerunAutomatedImports($imports) | Claims available runs, clears owned staging/review/errors and dispatches pre-import; skips active-run conflicts and preserves stored revisions/remaps |
Import Strategies
Strategy Factory
File: app/Services/Importer/ImportStrategies/ImportStrategyFactory.php
The factory maps import methods to strategy classes and resolves them via the service container:
class ImportStrategyFactory
{
protected $import;
protected $strategies;
public function __construct($import)
{
$this->import = $import;
$this->strategies = [
Import::$IMPORT_METHOD_FILE => SpreadsheetImportStrategy::class,
Import::$IMPORT_METHOD_COPY => CopyPasteImportStrategy::class,
Import::$IMPORT_METHOD_LEGACY_EF => LegacyEFImportStrategy::class,
Import::$IMPORT_METHOD_CVENT => CventImportStrategy::class,
Import::$IMPORT_METHOD_SWOOGO => SwoogoImportStrategy::class,
Import::$IMPORT_METHOD_GOOGLE_RSVP => GoogleRsvpImportStrategy::class,
];
}
public function createStrategy(): ImportStrategyInterface
{
$strategy = $this->strategies[$this->import->import_method] ?? null;
if (! $strategy) {
throw new \Exception('Invalid import method');
}
$strategy = app($strategy);
$strategy->setImport($this->import);
return $strategy;
}
}
Registered Strategies
| Strategy Class | Import Method Constant | Value | Description |
|---|---|---|---|
SpreadsheetImportStrategy | $IMPORT_METHOD_FILE | file | CSV/XLSX/XLS file uploads via PhpSpreadsheet |
CopyPasteImportStrategy | $IMPORT_METHOD_COPY | copy_paste | Clipboard or pasted tabular data |
LegacyEFImportStrategy | $IMPORT_METHOD_LEGACY_EF | legacy_ef | Legacy EventFinity REST API sync |
CventImportStrategy | $IMPORT_METHOD_CVENT | cvent | Cvent REST API integration |
SwoogoImportStrategy | $IMPORT_METHOD_SWOOGO | swoogo | Swoogo REST API integration |
GoogleRsvpImportStrategy | $IMPORT_METHOD_GOOGLE_RSVP | google_rsvp | Attendee snapshot import at develop 25e1564; verified event connection required |
Shared attendee snapshot cleanup
At develop 25e1564, the attendee-snapshot cleanup dispatch also covers Google RSVP. No-data settlement, successful/failed pre-import settlement, eligible failure cleanup, reset/retry/cancel and import deletion call that shared cleanup through their respective run/ownership conditions. Snapshot cleanup removes working source input; it does not roll back imported attendee changes, remove every review/upload artifact or establish complete personal-data deletion. Preserve the run identity and inspect actual cleanup/results before retrying or retiring an import. The Cvent-specific source behavior below remains separate from Google's API and mapping contract.
Cvent prerequisites and metadata side effects
Cvent metadata has branches for attendees, attendee fields and agenda items; appearing in the general import registry does not make another type Cvent-compatible. Supply the intended integration token and import_config.cvent_event_id. Metadata rejects a missing event ID.
Before collecting attendee metadata, the strategy retrieves Cvent registration types and finds or creates corresponding project attendee types. Nonempty trimmed registration codes become lowercase slugs; existing matching project/slug records are reused. This happens during metadata preparation, before manual row approval. Requiring review does not make that preparation read-only, and later cancellation does not establish removal of those types.
Attendee remapping preserves explicit existing mappings, uses configured presets and matches project field names/slugs after normalization. Unrecognized columns can be omitted. Confirm the destination fields, selected matching key and final mapping before approval rather than assuming every provider field will be written.
Event questions, custom fields and registration types use event-scoped cache keys with a ten-minute TTL. Metadata explicitly clears those caches when automatic processing is disabled; automatic runs can reuse them. If provider definitions changed, inspect refreshed metadata and mappings before relying on the next synchronization.
Cvent custom fields and question answers
Attendee custom fields are extracted from contact custom fields using the provider field name. Array values become comma-joined strings, while scalar values are retained; the nested custom-field list is then removed. This is not a lossless representation of array elements containing commas.
Question IDs are matched to cached event-question text. Single answer values remain single values, multiple values are comma-joined, and an empty answer array produces the literal No Answer. An unmapped question ID uses Unknown Question. These fallback strings are values/keys, not a guarantee of an empty or ignored destination field; inspect the final remapping and validation.
The shared column-name sanitizer preserves spelling and punctuation, truncating names to 255 characters. It does not generate unique slugs. Duplicate names, identical question text or names that collide after truncation can overwrite an earlier value in the row. Use distinct provider labels and review destination mappings; a successful retrieval cannot recover an overwritten source value.
Attendee-field metadata reads flattened field definitions, derives headers from the first returned row and applies configured mappings to otherwise unmapped columns, omitting unknown ones. Existing remaps take priority. Metadata field definitions can be cached, while the data branch retrieves definitions again; verify refreshed headers and mapping if definitions change during an import.
Cvent agenda-session imports
Session metadata uses the configured agenda headers and the first page's reported total (or first-page count when the total is absent). Retrieval follows opaque next-page tokens and normalizes the returned sessions. Confirm fetched versus expected counts when a provider response lacks its total; a metadata count alone does not prove complete ingestion.
| Session value | Imported behavior |
|---|---|
| ID/source | Matches the provider identity as configured and marks the source as Cvent |
| Missing code | Generates a title slug with a deterministic suffix from session ID; without an ID the suffix is random |
| Unlimited capacity | Clears the imported capacity value rather than treating it as a fixed limit |
| Start/end and automatic open/close timestamps | Converts parseable timestamps to UTC; an unparseable nonempty value is logged and cleared |
| Existing enrollment settings | Preserves the project's existing enabled/type/conflict settings for that session |
| New session enrollment settings | Exact Active status enables enrollment; defaults to open enrollment and warn conflict mode |
| Included with registration | Stores true/false when supplied and null when the provider omits the key, mapped to cvent_included_session |
| Location name | Saves a session-ID/name mapping used by the separate post-import location strategy |
The included flag describes a session included for event registrants; it is not an imported list of individual enrollment records. Review that flag before interpreting a zero enrollment count as missing registrations. Location processing adds links as described under post-import strategies; it does not remove earlier links.
Session-page rate limits permit up to two local retry sleeps, each only when the requested delay is at most 30 seconds; larger delays or exhausted attempts are rethrown. Inspect the import's errors and provider availability instead of assuming pagination waits indefinitely. Live provider rate-limit and distributed retry behavior still require environment verification.
Cvent attendee working snapshots
Cvent attendee metadata streams the fetched dataset into JSONL files, one per pre-import chunk, and reports the actual number of rows written. Chunk retrieval reads its corresponding snapshot file rather than making another attendee API request. This is a working input for the current pre-import run; it is not a permanent provider export or an immutable historical record.
Files use the dedicated importer_snapshots disk. The reviewed local configuration stores them outside the public storage root with serving disabled; the cloud branch declares private visibility. Metadata and chunk workers must access the same configured storage. Verify deployed storage permissions and availability before using this path; local fake-storage tests do not establish cloud privacy or multi-worker access.
A snapshot write replaces the import's directory, JSON-encodes rows with exceptions enabled and fails if a chunk cannot be written. Reading a missing, unreadable, empty or malformed chunk raises an error rather than treating it as a successful zero-row window. Check the recorded source/storage error and restart through the supported import lifecycle after confirming source availability.
Paths are keyed by import ID, not run token. Run ownership checks govern lifecycle writes and settlement cleanup, but the snapshot store itself does not provide per-run isolation or locking. Do not bypass orchestration to write a snapshot concurrently with an active import.
The working snapshot is removed by the pre-import cleanup paths after owned settlement or a no-data result; permanent parent failure also checks ownership before cleanup. Post-review import reads staged EAV data, so it does not require the raw snapshot once pre-import settles. The native snapshot tests also cover removal when the import record is deleted. Preserve your original source independently when a later reconciliation may be needed.
Legacy Eventfinity source behavior
The strategy has metadata branches for attendees, attendee fields and agenda items. Other registry types do not automatically gain Legacy Eventfinity support and fail when metadata cannot be resolved. The integration token must identify a configured legacy environment; event-scoped resources require an event ID, obtained from the import configuration override or the token's legacy event ID.
Attendee metadata preserves existing remaps and can mark unknown headers as omitted when they do not match project attendee fields or recognized standard fields. Review destination fields and mapping before approval. The strategy assigns sequential row numbers to returned pages; these are pagination positions, not stable external record identities.
The reviewed defaults use 500 rows per page and one page per job, configurable through the legacy import settings. Unlike the Swoogo count described below, this strategy computes job count from metadata row count. Each window uses an inclusive end row and is converted to one-based page numbers. The service reads through the requested end page; without an end page it continues while a page has the requested size. Data changing between requests can move page boundaries, so reconcile by the chosen matching key.
The integration cursor is supplied as updated_after. Import configuration is merged into the strategy request payload, but the service then applies pagination values and configured resource defaults; a conflicting import-level option is not guaranteed to win. Inspect the configured resource parameters when an override appears ineffective.
For agenda timestamps, import_config.timezone identifies the source timezone (UTC when omitted), and formatters convert the interpreted local value to UTC. Local checks cover winter and summer offsets for America/New_York. Validate source timezone and actual values before synchronizing schedules. Attendee check-in formatting recognizes the exact CHECKED_IN value; attendee-field multiselect/multicheckbox types become multi_select, and options are rendered as comma-separated value:label pairs.
Swoogo source behavior and limits
The strategy implements attendee and attendee-field retrieval; other types throw an unsupported-type exception. The current Swoogo integration configuration exposes attendee integration support, so the presence of an attendee-field branch does not establish that every dashboard flow offers it. Supply the correct integration token and import_config.swoogo_event_id; metadata rejects a missing event ID.
Attendee metadata queries event questions and a registrant total. Custom c_ attributes use a preferred question name (public short name, then admin short name, then name), and incoming structured values with a value member are flattened to that value. Headers not recognized as standard metadata fields or existing project attendee fields can be automatically omitted unless already remapped. Inspect mappings and destination field definitions before assuming that every Swoogo field is imported.
The stored integration cursor becomes an updated_at> search filter. Provider pages can move while data changes; row numbers assigned from a requested window are not stable provider record identities. Reconcile records using the configured matching key and avoid interpreting a successful batch as a complete provider snapshot.
Window limit: with the reviewed defaults (200 rows per page, five pages per job), getChunkSize() returns five jobs regardless of metadata row count. Their windows cover indexes 0–4,999. If the provider reports more rows, this schedule does not cover the remaining windows. The actual method/range calculation has been reproduced with synthetic row counts; it is not proof of a successful live retrieval. Verify complete expected-versus-imported counts before relying on a large Swoogo synchronization.
The Swoogo service follows all reported pages when no end page is specified, but with an explicit end page it runs to that requested boundary. Request failures are logged and rethrown; a first 401 triggers one token-refresh retry. Check recorded errors, token configuration and provider availability when retrieval fails.
The autoProcessingImportMethods() helper lists these third-party methods. fetchActiveAutomatedImports() uses this list; the minute scheduler uses a separate eligibility query described below:
public static function autoProcessingImportMethods()
{
return [
self::$IMPORT_METHOD_LEGACY_EF,
self::$IMPORT_METHOD_CVENT,
self::$IMPORT_METHOD_SWOOGO,
self::$IMPORT_METHOD_GOOGLE_RSVP,
];
}
ImportStrategyInterface
File: app/Services/Importer/ImportStrategies/ImportStrategyInterface.php
Every strategy must implement this contract:
interface ImportStrategyInterface
{
public function setImport(Import $import);
public function getMetadata(Import $import): StrategyMetadataDTO;
public function getImportData(int $startRow, int $endRow): array;
}
setImport()-- Injects the Import model into the strategygetMetadata()-- Returns aStrategyMetadataDTOwith row count and column headersgetImportData()-- Returns an array ofRowDTOobjects for the given row range
BaseImportStrategy
File: app/Services/Importer/ImportStrategies/BaseImportStrategy.php
Abstract base class that implements setImport() and provides generateFuzzyColumnMappings() for automatic column header matching. Strategies may optionally override getJobStartRow(), getJobEndRow(), and getChunkSize() for custom chunking behavior.
Setup Steps For New Models
1. Define Import Configuration
Add a static importConfig() method to your model. The configuration defines which columns can be imported, their data types, validation rules, and which fields serve as import keys for matching existing records.
The model method is distinct from the Import record's stored import_config attribute. Import::importConfig() calls the target model's static method; it does not merge stored source parameters into the model schema. Use stored configuration for source context such as event IDs or integration options, and use model configuration/its runtime columns closure for supported columns and rules. Supplying a columns entry in stored source configuration does not redefine the importable model. Models can separately read that context when implementing their own closures.
The model fragments below assume use App\Models\Import;; the custom matching-query fragment also assumes use Illuminate\Database\Eloquent\Builder;. They illustrate extension points, not a complete model/schema or a production authorization boundary.
Simplified static configuration fragment:
public static function importConfig(?Import $import = null): array
{
return
[
'columns' => [
'id' => [
'type' => Import::$TYPE_INTEGER,
'rule' => 'nullable|integer',
],
'name' => [
'type' => Import::$TYPE_TEXT,
'create_rule' => 'required|string',
'update_rule' => 'sometimes|string',
],
'slug' => [
'type' => Import::$TYPE_TEXT,
'create_rule' => 'required|string',
'update_rule' => 'sometimes|string',
],
'group_type' => [
'type' => Import::$TYPE_TEXT,
'create_rule' => 'required|string',
'update_rule' => 'sometimes|string',
],
'sort_mode' => [
'type' => Import::$TYPE_TEXT,
'create_rule' => 'sometimes|string',
'update_rule' => 'sometimes|string',
],
'saved_search_id' => [
'type' => Import::$TYPE_TEXT,
'create_rule' => [
'required_if:group_type,dynamic',
'exists:saved_searches,id',
'nullable',
],
'update_rule' => [
'required_if:group_type,dynamic',
'exists:saved_searches,id',
'nullable',
],
],
],
'import_keys' => [
'id',
'name',
],
];
}
The exists:saved_searches,id rules above only check existence; they do not establish ownership by the current project. Before using related IDs in production, scope their validation to the import project. Import::importConfig() invokes the model configuration without an Import argument; obtain runtime project context through the columns closure instead of relying on the optional static-method parameter.
Dynamic closure-based configuration fragment:
When column configuration must be computed at runtime (e.g., dynamic attendee fields), use a closure for the columns key. The closure receives the Import model whenever columnConfig() resolves it. The current resolver does not cache the result once per job; keep repeated evaluation safe.
public static function importConfig(?Import $import = null): array
{
return [
'columns' => function (Import $import): array {
// Return actual model columns; add project-specific definitions here.
return [
'id' => [
'type' => Import::$TYPE_INTEGER,
'rule' => 'nullable|integer',
],
'name' => [
'type' => Import::$TYPE_TEXT,
'create_rule' => 'required|string',
'update_rule' => 'sometimes|nullable|string',
],
];
},
'import_keys' => ['id'],
];
}
This is an extension fragment for a model with those attributes, not the full built-in Attendee configuration. Add authorization, scoped lookup, model/schema rules and type-specific handlers before exposing a new import type.
Column Configuration Reference
Each column needs a supported type and either a shared rule or both create/update rules for ordinary writable columns. validationRulesFromColumnConfig() rejects missing create/update rules. Relation/transform columns also need their corresponding handlers; a type label alone does not implement them.
Column configuration keys:
| Key | Required | Description |
|---|---|---|
type | Yes | Data type constant (see below) or special types: transform, relation |
rule | No | Shared validation rule for both create and update (string, array, or closure) |
create_rule | No | Validation rule applied only when creating a new record |
update_rule | No | Validation rule applied only when updating an existing record |
jsonbMap | No | Target JSONB column name -- nests this field's value into the specified JSONB attribute |
default | No | Closure returning a default value for new records: function ($row) { ... } |
formatter | No | Source formatter used by spreadsheet/paste: called with value, source row and Import when its config key exists in that row |
transform | No | Closure for transform-type columns: function ($columnName, $value, $row) { ... } |
target_column | No | For transform columns, the actual database column to write to |
handle | No | Closure for relation columns: function ($value, $row, $model) { ... } |
column | No | For attachment columns, the target column on the model |
A callable rule, create_rule or update_rule is a rule generator: after choosing create versus update, ValidationLayer invokes it with the remapped, cast row and passes its return value to Laravel validation. Return the intended rule string/array or supported rule value. This differs from a Laravel attribute/value/fail callback; placing that three-argument callback directly in this slot does not match the invocation contract. Relation and transform values remain uncast in that row.
The model's top-level import configuration can also declare prepare_chunk, called with the Import and incoming row DTOs before existing-record matching and validation. Its return value is not used to replace the row list. Implement repeated evaluation and worker retries safely, and verify any prepared state against the actual source headers. This hook is not a transaction or an exactly-once side-effect guarantee.
Relation handlers receive the relation value, a row array and the target model, and must perform the intended relationship changes themselves. Their return value is not assigned to a target attribute. False-like values—including null, empty strings/arrays, false, zero and the string 0—skip the handler; a blank relation cell therefore does not implement detaching or clearing relationships.
On update, relation handlers run before ordinary attributes are filled/saved and receive the mapped row. On create, the model is filled/saved first and handlers receive the source row. Both occur within the row transaction, but custom external effects do not become reversible merely because database work is transactional. Write and verify handlers for both operation paths; do not assume identical row-key shapes or model persistence state.
Ordinary create/update writes use the model's fill() and save(). Adding a column to import configuration alone does not make the corresponding model attribute writable or satisfy its schema/model rules. Confirm the target model's mass-assignment configuration and resulting persisted values when adding an importable field.
formatRows() matches raw source keys to the configuration keys before normal remapping. A renamed header can therefore bypass a formatter attached to its destination slug; null values also do not pass its isset check. Test formatted input under the actual uploaded/pasted headers instead of assuming a remap invokes that formatter.
Cvent, Swoogo and Legacy Eventfinity attendee strategies use a separate email-normalization helper. It resolves email-typed project fields and the platform contact-email slug, including every source header mapped to one of those fields, and trims/lowercases string values. Non-attendee imports and non-string values are left for their own processing. This is email normalization, not general execution of every configured formatter for integrations.
Data Type Constants
| Constant | Value | Description |
|---|---|---|
$TYPE_TEXT | text | Long text |
$TYPE_STRING | string | Short string |
$TYPE_EMAIL | email | Email address |
$TYPE_DATE | date | Parsed Carbon date/time value; destination rules determine acceptance |
$TYPE_TIME | time | Parsed Carbon date/time value; not a strict H:i:s parser |
$TYPE_DATETIME | datetime | Parsed Carbon date/time value |
$TYPE_INTEGER | number | Integer |
$TYPE_DECIMAL | decimal | Decimal/float |
$TYPE_BOOL | boolean | Boolean |
$TYPE_ARRAY | array | Array |
$TYPE_JSON | json | JSON input decoded to a PHP value, then subject to column validation |
$TYPE_HEX | hexColor | Hex color code |
$TYPE_URL | url | URL |
$TYPE_ATTACHMENT | attachment | File URL to download and attach |
2. Add the Importable Trait
Add the Importable trait to your model. This provides helper methods used throughout the pipeline:
use App\Traits\Importable;
class Group extends Model
{
use Importable;
// ...
}
The trait provides:
| Method | Description |
|---|---|
importHeaders() | Legacy flat-config helper; do not use as the current nested column resolver |
importRules() | Legacy flat-config helper; current rule resolution uses the resolved column array |
generateSampleData($rowCount) | Uses legacy flat-config helpers; not the current CSV-template contract |
getAvailableColumnHeaders(Import) | Reads top-level config keys; for current column slugs use array_keys($import->columnConfig()) |
uniqueItemsByImportKeyQuery(Import, array) | Queries existing records by import key for create/update determination |
importableExistingCount(Import) | Returns count of existing records scoped to project or team |
resolveUniqueKeyForImport(Import) | Returns the unique key field name for the import |
3. Register Import Type
Add this entry to the existing return array in Import::importTypes() in app/Models/Import.php, preserving all current registrations. This is an additive array entry, not a replacement method:
'my_model' => \App\Models\MyModel::class,
To offer a downloadable template, override both trait methods on the model:
public static function hasImportTemplate(): bool
{
return true;
}
public static function templateSampleRow(Import $import): array
{
return ['name' => 'Replace this sample'];
}
The default trait returns false and an empty sample. Sample keys are column slugs; the controller aligns values to the resolved header order. Remove or replace the sample row before importing.
4. Optional: Override uniqueItemsByImportKeyQuery
Override this method on your model only if you need custom logic for finding existing records. The default implementation scopes by project_id when present, otherwise team_id when present, and matches on the import key. If neither ID is present, it is unscoped. Require valid ownership context or enforce it in an override before exposing a custom type:
public static function uniqueItemsByImportKeyQuery(Import $import, array $uniqueValues): Builder
{
$query = $import->importClass()::query();
$uniqueKey = self::resolveUniqueKeyForImport($import);
if (isset($import->project_id)) {
$query->where('project_id', $import->project_id);
} elseif (isset($import->team_id)) {
$query->where('team_id', $import->team_id);
}
return $query->useWritePdo()->whereIn($uniqueKey, $uniqueValues);
}
Implementing a New Import Strategy
Step 1: Create the Strategy Class
The following in-memory example demonstrates the strategy contract without an external service. It uses zero-based row numbers and a half-open range: start inclusive, end exclusive, matching the default strategy chunk calculation. Production strategies must retrieve their records from a durable source and keep headers and row numbers consistent across retries. The default constructor contains no records.
<?php
namespace App\Services\Importer\ImportStrategies;
use App\Models\Import;
use App\Services\Importer\DTOs\RowDTO;
use App\Services\Importer\DTOs\StrategyMetadataDTO;
class MyServiceImportStrategy extends BaseImportStrategy
{
public function __construct(private array $records = [])
{
$this->records = array_values($records);
}
public function getMetadata(Import $import): StrategyMetadataDTO
{
return new StrategyMetadataDTO(
rowCount: count($this->records),
columnHeaders: array_keys($this->records[0] ?? ['name' => null]),
remappedColumns: null,
);
}
public function getImportData(int $startRow, int $endRow): array
{
$rows = [];
$fetchedData = array_slice($this->records, $startRow, max(0, $endRow - $startRow));
foreach ($fetchedData as $index => $record) {
$rows[] = new RowDTO(
rowNumber: $startRow + $index,
row: $record, // associative array: column_name => value
errors: [], // optional error messages
);
}
return $rows;
}
}
Try the strategy contract with nonempty data
After loading the example class in the platform application, this direct construction exercises the same half-open range used by the retained documentation check:
$strategy = new \App\Services\Importer\ImportStrategies\MyServiceImportStrategy([
['name' => 'One'],
['name' => 'Two'],
['name' => 'Three'],
]);
$strategy->setImport($import);
$metadata = $strategy->getMetadata($import); // rowCount: 3; headers: ['name']
$rows = $strategy->getImportData(1, 3); // row numbers 1 and 2: Two, Three
Here $import is an Import model supplied by the caller; this call demonstrates metadata and row DTOs, not target writes or a complete orchestration run. The retained strategy check verifies these results and empty/out-of-range windows against the actual base/interface/DTO classes.
The factory resolves the class through the service container with its default constructor. Registering this in-memory example unchanged therefore produces zero rows. For a real integration, replace the in-memory records with durable source retrieval or register a source-aware container binding; implement that integration's credentials, pagination, error handling and replay identity. Do not expect records passed to a separate demonstration instance to appear in a factory-created instance.
Step 2: Register in the Factory
Add your strategy to ImportStrategyFactory and define a new import method constant on the Import model:
In Import.php:
public static $IMPORT_METHOD_MY_SERVICE = 'my_service';
Add this entry to the existing strategy registry in ImportStrategyFactory.php, preserving its current entries:
Import::$IMPORT_METHOD_MY_SERVICE => MyServiceImportStrategy::class,
Also add the new method to the import_method validation rule in Import::createRules().
If the strategy should run automatically, configure an enabled import, a valid interval and reusable source credentials/data, and verify the scheduler and queue behavior. Factory registration alone does not establish automatic support. fetchActiveAutomatedImports() filters through autoProcessingImportMethods(); add a method there if it must appear in that helper's results. The actual minute scheduler's processAutomatedImports() does not use that list: it scans enabled imports with a positive interval and due last_run_at, excluding Cvent agenda imports. Verify both paths rather than treating the helper list as the scheduler's allowlist. See Automatic scheduling and staging retention.
For an inbound integration that needs sync-back suppression, also review Integration tracking. A new factory entry does not automatically receive an integration origin marker.
DTOs
StrategyMetadataDTO (app/Services/Importer/DTOs/StrategyMetadataDTO.php):
class StrategyMetadataDTO
{
public int $rowCount;
public array $columnHeaders;
public $remappedColumns; // nullable
public function __construct(int $rowCount, array $columnHeaders, ?array $remappedColumns = null)
{
$this->rowCount = $rowCount;
$this->columnHeaders = $columnHeaders;
$this->remappedColumns = $remappedColumns;
}
}
RowDTO (app/Services/Importer/DTOs/RowDTO.php):
class RowDTO
{
public int $rowNumber;
public array $row; // associative array: column_name => value
public array $errors;
public function __construct(int $rowNumber, array $row, array $errors = [])
{
$this->rowNumber = $rowNumber;
$this->row = $row;
$this->errors = $errors;
}
}
Post-Import Strategies
Post-import strategies run per chunk after records are created/updated in the ImportLayer. They handle side effects that should occur after successful record creation.
PostImportStrategyInterface
File: app/Services/Importer/PostImportStrategies/PostImportStrategyInterface.php
interface PostImportStrategyInterface
{
/**
* Process post-import actions for created records.
*
* @param array<int> $createdIds IDs of records created in this chunk
* @param Import $import The import being processed
*/
public function processCreated(array $createdIds, Import $import): void;
/**
* Process post-import actions for updated records.
*
* @param array<int> $updatedIds IDs of records updated in this chunk
* @param Import $import The import being processed
*/
public function processUpdated(array $updatedIds, Import $import): void;
}
PostImportStrategyFactory
File: app/Services/Importer/PostImportStrategies/PostImportStrategyFactory.php
Resolves attendee and agenda_item. Other types return null, skipping this per-chunk strategy hook; run-level cleanup, notifications and deferred attachments are separate paths:
class PostImportStrategyFactory
{
private static array $strategies = [
'attendee' => AttendeePostImportStrategy::class,
'agenda_item' => AgendaItemPostImportStrategy::class,
];
public static function make(string $importType): ?PostImportStrategyInterface
{
$strategyClass = self::$strategies[$importType] ?? null;
return $strategyClass ? app($strategyClass) : null;
}
}
AttendeePostImportStrategy
File: app/Services/Importer/PostImportStrategies/AttendeePostImportStrategy.php
Attempts default credential assignment for newly created attendees. Updated attendees have no action in this strategy. An Exception is logged and swallowed, so successful attendee creation does not establish successful credential assignment; verify the resulting credentials when they are required:
class AttendeePostImportStrategy implements PostImportStrategyInterface
{
public function __construct(
private AttendeeCredentialService $credentialService
) {}
public function processCreated(array $createdIds, Import $import): void
{
if (empty($createdIds)) {
return;
}
try {
$this->credentialService->bulkAssignDefaultCredentials($import->project, $createdIds);
} catch (\Exception $e) {
\Log::error("Failed to assign default credentials in import {$import->id}: ...");
// Don't rethrow - allow import to complete
}
}
public function processUpdated(array $updatedIds, Import $import): void
{
// No post-processing needed for updated attendees currently
}
}
AgendaItemPostImportStrategy
File: app/Services/Importer/PostImportStrategies/AgendaItemPostImportStrategy.php
For Cvent agenda imports, both created and updated agenda items can receive location links. The strategy reads import_config.session_location_names, keyed by the agenda item's third_party_id. It skips non-Cvent imports, empty ID lists, items without a mapped name and empty mappings. A missing mapping logs a warning and skips location attachment.
For a mapped name, it finds or creates a ProjectLocation in the import project using the exact name, then finds or creates the agenda-item/location link with a null access point. Within each invocation, it reuses the resolved location ID for repeated names. New locations receive a slug with a random suffix. Repeated sequential calls reuse an existing matching link; this is not a guarantee against concurrent duplicate creation.
This code adds links; it does not remove a previous location when a later import changes the mapping, and it does not synchronize all location metadata. Per-item Exception failures are logged and processing continues. Check the agenda item's links and project locations after import rather than interpreting a successful import as proof that all location attachment succeeded.
The item query uses the chunk's supplied IDs and requires a non-null third-party ID; it does not independently filter those items by project. Custom callers must supply IDs belonging to the import project. The current project is used when finding or creating locations.
Field Mapping & Column Remapping
Automatic Fuzzy Column Matching
BaseImportStrategy::generateFuzzyColumnMappings() automatically maps incoming column headers to model field names using a multi-pass approach:
- Literal pre-pass: Exact column keys reserve their targets before later matching passes; review the final mapping rather than assuming this pre-pass guarantees identity
- Normalized match: Strings are lowercased; whitespace, hyphen and dot sequences become underscores; remaining characters outside ASCII letters, digits and underscores are removed
- Common remap lookup: Checks the
common_remap_columnsarray in import config for known aliases - Fuzzy matching: Uses PHP's
similar_text()with a 90% similarity threshold to match remaining unmatched headers
similar_text($normalizedHeader, $normalizedKey, $similarity);
if ($similarity > $highestSimilarity && $similarity >= 90) {
$bestMatch = $originalKey;
$highestSimilarity = $similarity;
}
Targets already reserved by earlier passes are excluded from later candidates, so header/configuration combinations affect the generated result. The current mapper can revisit a literal header in a later fuzzy pass: with first_name and first_names as targets, a lone first_name header maps to first_names in the reproduced source fixture. Review and explicitly correct mappings where target names overlap; a high similarity score is not proof of the intended field.
Manual Column Remapping
Users can manually remap columns through the review UI. The remapped_column_headers JSON column on the Import model stores a mapping of original_header => target_field. The special value [OMIT] causes a column to be skipped entirely:
public static $OMIT_COLUMN_VALUE = '[OMIT]';
The ColumnRemapper helper class translates between original headers and remapped field names throughout the pipeline. Its reverse mapping uses flipped destination values, so multiple source headers mapped to one destination cannot preserve an unambiguous reverse lookup. Choose one source column per intended destination and verify the preview. The validColumns() method on the Import model filters out omitted columns:
public function validColumns()
{
$validHeaders = [];
foreach ($this->column_headers as $header) {
if (is_string($header) &&
(! isset($this->remapped_column_headers[$header]) ||
$this->remapped_column_headers[$header] !== self::$OMIT_COLUMN_VALUE)) {
$validHeaders[] = $header;
}
}
return $validHeaders;
}
Import Jobs Pipeline
The import system uses Laravel Bus batching to process data in parallel chunks. Each chunk runs as an independent job within a batch.
Job Classes
| Job | Parent Class | Purpose |
|---|---|---|
PreImportProcessingJob | BaseImportJob | Entry point. Runs MetadataProcessingLayer, dispatches batch of ChunkedPreImportProcessingJob |
ChunkedPreImportProcessingJob | BaseChunkedImportJob | Per-chunk: DataRetrieval -> Validation -> EAV Storage (or direct import for auto-processing) |
RevisionProcessingJob | BaseImportJob | Dispatches placeholder revision chunks, then returns an owned uncancelled run to pre-import |
ChunkedRevisionProcessingJob | BaseChunkedImportJob | Revision-processing method is empty; no cell edits are applied |
ImportJob | BaseImportJob | Post-approval entry point. Dispatches batch of ChunkedImportJob |
ChunkedImportJob | BaseChunkedImportJob | Per-chunk: DataRetrieval (from EAV) -> Validation -> ImportLayer |
PostImportJob | BaseImportJob | Runs completion cleanup, attendee aggregate maintenance/analytics, ImportComplete broadcast and manifest-backed ImportCompleted workflow dispatch |
CleanupImportsJob | ShouldQueue | Queued by daily cleanup command; deletes staging data for imports whose updated_at is older than one day |
ProcessAutomaticImportsJob | ShouldQueue | Empty placeholder; automatic scheduling uses the command/service path |
Chunking
The default row size is config('importer.default_chunk_size') (50 in the reviewed configuration). Without a strategy override, pre-import job count is calculated as:
$chunks = ceil($rowCount / $chunkSize);
Despite its name, a strategy's getChunkSize() is consumed by PreImportProcessingJob as the number of jobs. Returning a row size there would schedule that many jobs. The strategy's getJobStartRow() and getJobEndRow() must define matching ranges for those job indexes; provider strategies can use different endpoint conventions from the default source path. Test boundaries together rather than copying one override in isolation.
Approved imports use the model's separate chunk_size configuration and freeze it on each dispatched chunk. Collection-entry imports can select the file-import setting when mapped fields include files; that setting is not a universal row size for all uploaded spreadsheets.
The reviewed pipeline routes parent and chunk jobs to the imports queue. A queued import can remain pending if its workers are unavailable; changing the queue name in an extension does not establish that a worker serves it. Worker deployment, recovery and capacity procedures belong in the separate operator runbooks.
Base Job Classes
BaseImportJob provides:
- A UUID generated at parent-job construction and passed to its chunk jobs; this is distinct from the orchestrator’s run-ownership token
- Strategy factory initialization
setStatus(),storeImportErrors(),getRequiredBatchJobCount()- Captured
runToken, primary-database ownership checks and conditional status/error/batch writes, plusSkipIfBatchCancelledmiddleware
BaseChunkedImportJob provides:
Batchabletrait for Laravel Bus batchingchunkGenerator()for breaking Generator output into fixed-size arrays- Failure handling with
ImportErrorstorage - Configurable memory limits via
config('importer.job_memory_limit') - Row-checkpoint lookup against the primary database for supported stable-row sources
- Attempt-specific chunk keys and deferred attachment jobs that join an existing batch when present
Chunk jobs do not carry the parent's run token. Their concrete middleware skips cancelled batches, but cancellation cannot interrupt an already executing chunk. The orchestration claim guard holds a new run off for a job allowance after cancellation; do not interpret the parent's token checks as a universal per-write fence for every chunk or external effect. Inspect committed rows and attachment work before restarting.
The chunk key includes the job index, sub-chunk index and current queue attempt, so a retried pass can open a fresh manifest rather than reuse an already closed or leased one. This manifest identity is separate from target-record matching keys, imported-row checkpoints and the run token. Each answers a different replay/ownership question.
Data Macros
The Import model declares [CLEAR], [DELETE], [GENERATE] and a generate-template regex, but the reviewed core validation/casting path does not implement those values as universal cell commands. Do not use them expecting a record deletion, field clear or generated value. Text fields can retain them literally; other field types can reject them during casting or validation. A type-specific handler must explicitly support a behavior before it can be relied on.
[OMIT] is a column-mapping/header marker recognized during validation: a column remapped to that value is skipped. It is not a general instruction to put [OMIT] into an ordinary data cell.
Blank and typed values
The field caster converts null, empty strings and whitespace-only strings to null before type handling, including text, numeric, date, boolean, JSON and attachment fields. Validation still determines whether null is allowed; a required field can fail. The later write handler determines the effect of an accepted null, so a blank cell alone is not a universal guarantee of clearing an existing value.
- Text/string/email/URL/attachment values otherwise remain strings; their validation rules can reject unsuitable values.
- Integer and decimal values must pass their numeric casts; invalid values produce casting errors rather than silently becoming zero.
- Boolean casting accepts true/false and 1/0, including their string forms. Nonempty strings are normalized to lowercase, but arbitrary labels such as yes/no are not accepted by this generic caster.
- Array fields accept arrays, numeric singletons, JSON-decodable strings or comma-separated strings. JSON decoding is followed by field validation; a decodable scalar is not automatically a valid array for every column.
- Date/time values use
Carbon::parse()rather than strict format-specific parsing. Supply unambiguous values and confirm the intended timezone and destination rules. JSON input is decoded with associative arrays enabled; valid scalar JSON can decode to a scalar, and JSONnullbecomes null. Column validation still determines whether that result is accepted. Hex colors must match the supported three- or six-digit form with a leading#. Confirm the preview before approving writes.
Integration Tracking
For recognized third-party methods, the system supplies an origin marker that compatible downstream consumers can use to suppress sync-back:
public const INTEGRATION_EVENTFINITY = 'eventfinity';
public const INTEGRATION_CVENT = 'cvent';
public const INTEGRATION_SWOOGO = 'swoogo';
public static function importMethodToIntegration(?string $importMethod): ?string
{
return match ($importMethod) {
self::$IMPORT_METHOD_LEGACY_EF => self::INTEGRATION_EVENTFINITY,
self::$IMPORT_METHOD_CVENT => self::INTEGRATION_CVENT,
self::$IMPORT_METHOD_SWOOGO => self::INTEGRATION_SWOOGO,
default => null,
};
}
ImportLayer sets sourceIntegration before saving only when the method has a non-null mapping and the model declares that property. Deferred attachment writes use the same mapping/property check. The marker is not automatic protection for every model, event or outbound integration.
For a new inbound method, add its origin mapping to Import::importMethodToIntegration(), declare compatible model origin handling, and make the relevant outbound observers/listeners recognize that origin. Preserve it across queued events and deferred writes where needed. Unknown methods return null; registering a strategy alone does not suppress sync-back. Verify an inbound-change/outbound-suppression test for the specific integration before enabling bidirectional operation.
Database Schema
imports
| Column | Type | Description |
|---|---|---|
id | bigint | Primary key |
name | string | User-defined import name |
file | json | Uploaded-file descriptor used by file-storage helpers |
pipeline_stage | string | Current pipeline stage |
status | string | Current status |
import_method | string | Strategy type: file, copy_paste, legacy_ef, cvent, swoogo |
import_type | string | Target model type: attendee, group, etc. |
import_key | string | Field used to match existing records (default: id) |
column_headers | json | Array of detected column headers |
remapped_column_headers | json | Manual column remapping overrides |
column_errors | json | Column-level validation errors |
data_revisions | json | Stored revision field; dashboard updates do not accept it and reviewed revision workers do not apply cell edits |
row_count | integer | Total number of data rows |
metadata | json | Run token, pending integration cursor and other run/settings metadata |
batch_ids | jsonb | Laravel Bus batch IDs keyed by stage |
import_config | json | Stored source/integration parameters; distinct from the target model import schema |
project_id | integer | FK to projects |
team_id | integer | FK to teams |
owner_id | integer | Polymorphic owner ID |
owner_type | string | Polymorphic owner type |
reviewer_id | integer | Polymorphic reviewer ID |
reviewer_type | string | Polymorphic reviewer type |
review_status | string | approved or declined |
reviewed_at | timestamp | When review occurred |
integration_token_id | integer | FK to integration tokens (for API imports) |
requires_review | boolean | Whether import needs manual approval |
auto_processing_enabled | boolean | Enables automatic processing; the pre-import chunk path also bypasses manual staging when true |
auto_processing_interval | integer | Seconds between auto-processing runs (min 300) |
last_run_at | timestamp | Run timing used by automatic eligibility; also written by run lifecycle actions |
process_after_timestamp | timestamp | Integration updated-after cursor; not a next-run schedule |
The integration cursor is promoted when the relevant run settles successfully. Pre-import stores a candidate cursor in metadata; the settling run uses that candidate when available. Legacy Eventfinity uses the stored cursor as updated_after, and Swoogo uses it in an updated-at filter. The minute scheduler uses last_run_at and the interval for due eligibility. Do not change the cursor expecting to schedule a future run.
import_cells
EAV (Entity-Attribute-Value) storage for individual cell values during review.
| Column | Type | Description |
|---|---|---|
import_id | integer | FK to imports |
column_name | string | Column/field name |
row_number | integer | Row index |
value | text, nullable | Staged cell representation |
Unique constraint on (import_id, column_name, row_number).
import_rows
Per-row metadata and results.
| Column | Type | Description |
|---|---|---|
import_id | integer | FK to imports |
row_number | integer | Row index |
entity_id | bigint, nullable | Target record ID for successful rows; no single target-table foreign key |
validation_errors | json | Per-cell validation error messages |
operation | string | create, update, or omit |
result_status | string | pending, success, failed, or skipped |
result_message | string | Human-readable result description |
imported_at | timestamp, nullable | Recorded processing/attempt time; inspect result_status to establish success |
Unique constraint on (import_id, row_number).
import_job_errors
Errors collected during job execution.
| Column | Type | Description |
|---|---|---|
import_id | integer | FK to imports |
job_index | integer, nullable | Chunk/job index recorded with the error |
updated_rows | integer | Stored row-count field, default 0 |
errors | json | Array of error objects |
is_fatal | boolean | Whether the error should halt the import |
Troubleshooting an import
Start with the import ID, current status and pipeline stage, the selected source/matching key, and the dashboard's row results and grouped errors. The dashboard page merges job-error arrays and groups them by errorType. Its standard AJAX response returns the import model rather than those separate page props; do not assume the two responses have identical shapes.
| Symptom | Check and next action |
|---|---|
column_headers_missing | Check that the first retained row contains headers, that the uploaded file contains the intended worksheet, and that paste input was parsed into columns. |
invalid_import_key | Confirm the selected key is a recognized column and is present under its original or remapped header. Create-without-key support can relax presence, but does not make an unknown configured key valid. |
invalid_column_header | Review the mapping and omit unused columns. Header validation records unknown columns as warnings; that does not prove the intended field will be written. |
could_not_retrieve_metadata | Read the message and source configuration. This wrapper catches exceptions during metadata extraction/validation; the label alone does not establish a network outage. |
could_not_retrieve_data or failed source retrieval | Check source availability, credentials and the recorded message. Preserve the source before retrying, and distinguish worker redelivery from starting a new run. |
| Row validation or create/update failures | Review row messages, mapped values and create/update rules. Successful rows may already exist in the target; reconcile them before a new run. |
| Active-run conflict | Inspect the current run and batch state. A long elapsed time alone does not release its ownership guard; do not treat retry/reset as a forced takeover. |
| Successful status but missing credentials, locations or files | Inspect the specific resulting records and attachment errors. Per-item post-import failures can be logged without failing the whole import, and notification events do not prove all side effects succeeded. |
| Review data no longer available | Staging cleanup can remove old rows, cells, errors and raw paste data. Confirm the original source remains available before attempting recovery. |
Understand review totals
The dashboard statistics endpoint requires view authorization and matching project identity. It counts the current import_rows records for that import:
| Response field | What is counted |
|---|---|
total_rows | All stored row records |
valid_rows | Rows whose operation is not omit |
invalid_rows | Rows whose operation is omit |
These are operation-based review totals, not counts of successful target writes. A create/update row can still have a pending or failed result; inspect result_status, messages and target records. Rows not yet staged are not included, and staging cleanup or restart can remove the records being counted. The source metadata row_count and the stored-row total therefore answer different questions.
The review's create/update/errors filters use the same operation distinction. Cell-value search uses staged cells belonging to the selected import, rather than searching the live target dataset. After staging cleanup, neither its search results nor review totals establish the current contents of the target module.
Error collections distinguish error and warning; hasFatalError() checks for an error-level entry. Persisted job records set is_fatal from the layer's validity result. These are stage/collection signals, not a rollback guarantee for records already written. Reset and retry clear stored errors/staging as documented above, so preserve relevant diagnostics before restarting.
Key Files Reference
Models
| File | Purpose |
|---|---|
app/Models/Import.php | Core import model with stages, statuses, macros, type constants, and config resolution |
app/Models/ImportRow.php | Per-row EAV metadata with operation types, result statuses, and validation states |
app/Models/ImportCell.php | Individual cell EAV storage |
app/Models/ImportJobError.php | Job error tracking |
Orchestration
| File | Purpose |
|---|---|
app/Services/Importer/ImportOrchestrator.php | Primary API for controlling import lifecycle |
Layers
| File | Purpose |
|---|---|
app/Services/Importer/Layers/BaseImportLayer.php | Base class for all layers |
app/Services/Importer/Layers/MetadataProcessingLayer.php | Metadata extraction and column validation |
app/Services/Importer/Layers/DataRetrievalLayer.php | Data fetching from strategy or EAV storage |
app/Services/Importer/Layers/ValidationLayer.php | Cell validation and create/update determination |
app/Services/Importer/Layers/IntermediateCellStorageLayer.php | EAV cell storage for review |
app/Services/Importer/Layers/RevisionLayer.php | Revision processing placeholder |
app/Services/Importer/Layers/ImportLayer.php | Record creation/update with JSONB, relations, transforms, attachments |
app/Services/Importer/Layers/CleanupLayer.php | Cache clearing and group refresh |
app/Services/Importer/Layers/NotificationLayer.php | Import completion event dispatch |
Strategies
| File | Purpose |
|---|---|
app/Services/Importer/ImportStrategies/ImportStrategyInterface.php | Strategy contract |
app/Services/Importer/ImportStrategies/BaseImportStrategy.php | Base class with fuzzy column matching |
app/Services/Importer/ImportStrategies/ImportStrategyFactory.php | Factory for resolving strategies by import method |
app/Services/Importer/ImportStrategies/SpreadsheetImportStrategy.php | CSV/XLSX file import |
app/Services/Importer/ImportStrategies/CopyPasteImportStrategy.php | Clipboard data import |
app/Services/Importer/ImportStrategies/LegacyEFImportStrategy.php | Legacy EventFinity API import |
app/Services/Importer/ImportStrategies/CventImportStrategy.php | Cvent API import |
app/Services/Importer/ImportStrategies/SwoogoImportStrategy.php | Swoogo API import |
Post-Import Strategies
| File | Purpose |
|---|---|
app/Services/Importer/PostImportStrategies/PostImportStrategyInterface.php | Post-import processing contract |
app/Services/Importer/PostImportStrategies/PostImportStrategyFactory.php | Factory for resolving post-import strategies |
app/Services/Importer/PostImportStrategies/AttendeePostImportStrategy.php | Attempts default credentials for new attendees |
app/Services/Importer/PostImportStrategies/AgendaItemPostImportStrategy.php | Adds Cvent agenda-item location links |
DTOs
| File | Purpose |
|---|---|
app/Services/Importer/DTOs/RowDTO.php | Row data transfer object |
app/Services/Importer/DTOs/StrategyMetadataDTO.php | Strategy metadata transfer object |
app/Services/Importer/DTOs/ValidatedRowDTO.php | Validated row with existing model reference and errors |
app/Services/Importer/DTOs/ImportResponseDTO.php | Layer response with rows, errors, validity flag |
Jobs
| File | Purpose |
|---|---|
app/Jobs/BaseImportJob.php | Abstract base for orchestration-level import jobs |
app/Jobs/BaseChunkedImportJob.php | Abstract base for per-chunk batch jobs |
app/Jobs/PreImportProcessingJob.php | Metadata extraction and chunk dispatch |
app/Jobs/ChunkedPreImportProcessingJob.php | Per-chunk: retrieval, validation, EAV storage |
app/Jobs/RevisionProcessingJob.php | Revision re-processing after user edits |
app/Jobs/ImportJob.php | Post-approval chunk dispatch |
app/Jobs/ChunkedImportJob.php | Per-chunk: retrieval, validation, import |
app/Jobs/PostImportJob.php | Cleanup and notification |
app/Jobs/CleanupImportsJob.php | Scheduled cleanup of stale EAV data (>1 day old) |
Traits & Helpers
| File | Purpose |
|---|---|
app/Traits/Importable.php | Trait adding import capabilities to Eloquent models |
app/Services/Importer/Helpers/ColumnRemapper.php | Column name remapping |
app/Services/Importer/Helpers/FieldCaster.php | Type casting for import values |
app/Services/Importer/Helpers/EAVDataToRowDTO.php | Converts EAV cell records back to RowDTO objects |
app/Services/Importer/Validators/ColumnHeaderValidator.php | Validates column headers against import config |
System import monitor guidance was supplemented on 2026-10-15 at platform 3b48eb675f7c8e3c4f0b87d0cd613fa7fb371093. No private import data, settings, source retrieval, approval, job, deletion or provider mutation was performed; global UI and deployed acceptance remain separate from prior importer test evidence.