Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Data Jobs

Laravel Data Jobs Laravel Package

badrshs/laravel-data-jobs

Laravel package that turns Artisan commands into one-time, trackable data migration jobs. It auto-discovers jobs, runs them in priority order, prevents duplicate execution, and records pending, running, completed, or failed statuses via a single data:run-jobs command.

View on GitHub
Deep Wiki
Context7

Laravel Data Jobs is a Laravel package for running one-time data migrations and transformations as controlled, trackable jobs. Add the DataJobable trait to any Artisan command and it becomes a discoverable data job that runs once by default, executes in priority order, and records its status — pending, running, completed, or failed — in the database. A single data:run-jobs command safely runs everything in sequence, making it ideal for migrating data after schema changes, backfilling fields for new features, or seeding production data.

  • Automatic discovery — no manual registration needed
  • Execution tracking — prevents duplicate runs and logs activity
  • Priority ordering — control which jobs run first
  • Graceful error handling — failures are logged, not fatal
  • Enable/disable jobs — skip jobs without deleting them
Frequently asked questions about Laravel Data Jobs
How do I define a one-time data migration job in Laravel using this package?
Add the `DataJobable` trait to your Artisan command class. The package automatically discovers and registers it. Define a `getPriority()` method to control execution order, and the job will run once by default, with status tracked in the `data_jobs_log` table.
Does this package support Laravel 10, 11, or 12? Will it work without modifications?
The package was last updated in 2021 and may require compatibility fixes for Laravel 10+. Test thoroughly, especially for Artisan command structures and dependency injection changes. Check the GitHub issues for reported Laravel 10+ compatibility notes.
Can I run data jobs asynchronously using Laravel Queues?
Yes, the package works with Laravel Queues if configured. Long-running jobs can be dispatched to a queue worker, but ensure your job logic handles queue-specific constraints like timeouts and retries.
How do I handle transient failures (e.g., database timeouts) in my data jobs?
The package lacks built-in retry logic, so you’ll need to implement custom error handling in your job’s `handle()` method. Use Laravel’s queue retries or wrap critical operations in transactions with retry logic for transient failures.
Will this package work in a multi-server environment (e.g., Kubernetes) without duplicates?
No, it assumes single-instance execution. For multi-server setups, use Laravel Queues with a centralized database or implement distributed locking (e.g., Redis) to prevent duplicate runs across servers.
How do I monitor job statuses in real time, like failed or pending jobs?
Job statuses (pending/running/completed/failed) are logged in the `data_jobs_log` table. Query this table directly or build a custom dashboard. For alerts, integrate with Laravel Events or third-party tools manually, as the package lacks native event support.
Can I disable or skip specific jobs without deleting them?
Yes, the package allows enabling/disabling jobs via configuration or runtime flags. Use the `--disable` flag with `data:run-jobs` or set `enabled = false` in the job’s metadata to skip execution while preserving the job definition.
What happens if a job fails mid-execution? How do I rerun it safely?
Failed jobs remain in the `data_jobs_log` table with their error details. Use the `--force` flag with `data:run-jobs` to rerun failed jobs, but ensure your job logic handles idempotency (e.g., avoid duplicate data inserts). Wrap critical operations in transactions for atomicity.
Are there any risks to adding the `data_jobs_log` table to production?
Yes, the schema must be version-controlled and migrated across environments. Failed migrations or schema conflicts in CI/CD pipelines could disrupt job tracking. Test migrations thoroughly and consider backing up the table before major changes.
What alternatives exist for priority-based data migrations in Laravel?
Consider Laravel’s built-in queue system with job priorities (via `afterCommit` or custom queue connections) or packages like `spatie/laravel-queueable-jobs` for more advanced scheduling. For distributed execution, tools like Temporal or AWS Step Functions may be better suited.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections