NewWe open-sourced 50+ Laravel packages
Custom AI apps, agents and automation — Roundly ConsultingRoundly
All packages
Imports for Laravel

Artisan commands

CommandDoes
imports:sweepExpires sessions past sessions.expire_after (file deleted), fails lost validations (preview_failed, abandoned) and stuck commits and rollbacks, releases their lock and cancels their job batch, removes temp directories older than storage.tmp_ttl. One session’s error is reported and the sweep carries on; a session whose owner was deleted is closed without its event.
imports:pruneDeletes source files, working copies and row results older than storage.retention; with history.retention also sessions, batches and ledger rows past it and past their undo window. Fires ImportsPruned.
imports:doctorThe setup checks below; exits non-zero on an error.
imports:importersA table of importers: key, label, kind, fields, modes, formats.
imports:template {importer} {--format=xlsx} {--locale=} {--output=}Writes a template file — --format xlsx or csv (else exit 1); default output ./<label-slug>.<ext>.
imports:installPublishes the config, the migrations and options-for-laravel’s migration (unless its table exists) and prints the next steps; exit 1 when the imports tables exist.
php artisan imports:sweep
# Expired N session(s), failed N stuck preview(s), N commit(s) and N rollback(s), removed N temp directory(ies).

php artisan imports:prune      # prints the PruneReport counts and fires ImportsPruned

Scheduling

Nothing is scheduled automatically:

// routes/console.php
use Illuminate\Support\Facades\Schedule;

Schedule::command('imports:sweep')->everyFiveMinutes()->withoutOverlapping(10)->onOneServer();
Schedule::command('imports:prune')->daily()->onOneServer();

From PHP

$report = Imports::sweep();   // SweepReport: expired, failedCommits, failedRollbacks, tempDirectories, failedPreviews
$report = Imports::prune();   // PruneReport: files, rowResults, sessions, batches, records

What the doctor checks

One finding per check — ok and info green, warning yellow, error red; each is a DoctorFinding (check, level, message):

CheckError / warning when
importersAn importer is invalid (error); none registered (warning).
key_typeimports.key_type differs from options.key_type (error).
job_batchesLaravel’s job_batches table is missing (error).
queueThe import queue is the sync driver (warning).
retry_afterThe queue connection’s retry_after is not above imports.commit.timeout (error).
diskThe disk is not configured or is public (error).
retentionstorage.retention is shorter than undo.window (warning: a failed import cannot be resumed once its file is pruned).
extensionszip, xmlreader, xmlwriter or mbstring is missing (error).
lock_storemappings.lock_store is not shared between servers (warning).
owner_scopeThe class is invalid (error); teams-for-laravel is installed but the default scope is used (warning).
options_tableMissing while saved mappings are on (error); info when they are off.
migrationsThe imports tables are missing (error).

Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

More ways to support, including crypto

By donating, you agree to our donation terms.

Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.