igniterlabs/ti-ext-importexport
ImportExport extension for TastyIgniter: export menu items, customers, reservations and orders to CSV, edit offline, then import updates back into your site. Simple CSV-based data migration and bulk updates for TastyIgniter records.
Extension class, registerImportExport()). This aligns well with Laravel’s modular architecture, enabling seamless integration into existing TastyIgniter-based applications.ImportModel, ExportModel) for custom logic, adhering to Laravel’s Eloquent and query builder patterns.league/csv) is reusable.php artisan igniter:up), which may conflict with existing schemas or CI/CD pipelines.Tools > Import/Export), requiring UI compatibility checks (e.g., Blade templates, JS dependencies).Validator::validate), increasing boilerplate for edge cases (e.g., nested relationships, multi-step workflows).offset/limit in exportData).league/csv library may not handle complex formats (e.g., merged cells, formulas) without extensions.menu_items, orders) match our existing schema? Are custom mappings needed?orders → customers).league/csv (v9.1), which supports:
league/csv’s Excel wrapper).composer require igniterlabs/ti-ext-importexport -W
php artisan igniter:up
MenuItem, Order) to support import/export via registerImportExport().customimport.php config for a Product model:
// resources/models/productimport.php
return [
'columns' => ['sku', 'name', 'price'],
'fields' => [
'update_existing' => ['label' => 'Update SKUs', 'type' => 'switch'],
],
];
Tools > Import/Export) for responsiveness and permission handling.resources/views/import/partials/upload.blade.php).ManageImports/ManageExports roles align with your RBAC system.registerImportExport() for bespoke models (e.g., Product, Inventory).importData().exportData() for large datasets.jobs table).ti-ext-importexport events).league/csv and TastyIgniter for breaking changes (e.g., PHP 8.4+ deprecations).composer.json to pin versions if using prefer-stable.importData()/exportData() methods for future maintainers.config('import-export.enabled')).orders).registerImportExport permissions).php.ini or use chunking).config('debugbar.enabled' => true)).logError() in importData() to capture row-level failures.public/templates/orders.csv).customer_id vs. email).public function importData(array $data): void {
foreach (array_chunk($data, 500) as $chunk) {
Model::insert($chunk);
}
}
offset/limit in exportData():
return $this->newQuery()->offset($options['offset'] ?? 0)->limit(1000)->get();
dispatch(new ImportJob($file, $model));
memory_limit (e.g., 512M) for large exports.| Scenario | Impact | Mitigation |
|---|---|---|
| Malformed CSV | Partial import, data corruption | Validate headers, use league/csv’s strict mode. |
| Database constraints | Failed inserts (e.g., unique keys) | Implement try-catch in importData(). |
| Concurrent imports | Race conditions | Use database transactions or optimistic locking. |
| Large file uploads | Server timeouts | Configure upload_max_filesize and max_execution_time. |
| Permission misconfigurations | Admin UI inaccessible | Audit registerImportExport permissions. |
ti-ext-importexport-starter) with registerImportExport() boilerplate.public function test_import_validates_sku(): void {
$this->import('products
How can I help you explore Laravel packages today?