vrok/import-export
A Laravel package for importing and exporting data, offering a simple API to move records between your application and external files. Useful for bulk data tasks, backups, and integrations, it aims to keep import/export logic reusable and easy to wire into existing models.
composer require vrok/import-export. There is no service provider requirement documented for most helper packages of this shape — check vendor/vrok/import-export/composer.json for extra.laravel.providers and for a publishable config before assuming zero setup.src/ are the real documentation. Budget 20–30 minutes to skim the entry points — you are looking for the export/import facade or service, the JSON shape it emits, and how it resolves relations.Category → children → translations) to a file, commit it, and restore it in a test. This exercises the round-trip with zero production blast radius.assertDatabaseHas on the root and at least one nested relation. If the shape doesn't survive that, stop there.SnapshotService or an Artisan command (snapshot:export, snapshot:import). Given the package's maturity signals, you want a single seam to patch or replace if an edge case bites you.format_version key to anything you persist and write a small upgrader. The emitter's shape is not a stable contract at 0.x.DB::transaction(). Define a natural key (slug, code, external_id) and use updateOrCreate semantics so re-running an import is safe. Prefer this over preserving source IDs.snapshots table, and surface it in the UI. Do not import a multi-megabyte graph inside a request.Validator against the decoded array against a schema (or a hand-rolled assertShape()) before touching the database. A malformed JSON should fail loudly at step zero, not halfway through the graph.Model::withoutEvents() or a static $importing guard) and re-index in a single pass afterward.fill() or forceFill(). Know which — with fill() any column not in $fillable silently disappears from the round-trip, and you'll only notice months later.created_at/deleted_at are preserved or reset. A snapshot restore that resurrects soft-deleted rows is a common surprise.storage/app/ and diff two exports when an import misbehaves. Log unrecognized keys during import rather than ignoring them, so schema drift is visible."vrok/import-export": "0.x.y") and lock it in composer.lock. With no dependents, you have no community signal that a patch release is safe.How can I help you explore Laravel packages today?