Domain Import APIs
Use typed presets for common business, education, CRM, ecommerce, and content imports.
Updated
importProducts()importUsers()importOrders()importInventory()importDomain()What you will learn
- Use a preset instead of rebuilding common mappings and rules.
- Override aliases, rules, defaults, transformations, and duplicate keys.
- Generate matching templates and previews from the same domain schema.
Domain imports add common aliases, canonical fields, normalization, validation, cross-field rules, duplicate keys, previews, templates, and progress on top of the generic SQL engine.
| Preset | Convenience method | Typical unique key |
|---|---|---|
| Users | importUsers() | email / username |
| Products | importProducts() | sku |
| Orders | importOrders() | order number |
| Inventory | importInventory() | sku + location |
| Students | importStudents() | student id |
| Attendance | importAttendance() | person + date |
| Marks | importMarks() | student + subject |
| Contacts | importContacts() | email / phone |
| Locations | importLocations() | code / coordinates |
| Blog posts | importBlogPosts() | slug |
| Media paths | importMedia() | path / URL |
| Categories | importCategories() | slug / code |
Complete example
$result = MnbExcel::importProducts(
'products.xlsx',
$pdo,
'products',
[
'batch_size' => 1000,
'duplicate_strategy' => 'update',
'unique_by' => ['sku'],
'failed_rows_csv' => __DIR__ . '/failed-products.csv',
]
);Override the preset
Presets are defaults, not locked schemas. Override mappings, aliases, rules, defaults, normalizers, transformations, unique keys, duplicate behavior, sheet selection, progress, and failed-row paths per application.
Was this guide useful?Use GitHub issues for corrections, missing examples, or unclear behavior.
Open an issue