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 Job Models Laravel Package

repat/laravel-job-models

Two Eloquent models for Laravel's jobs and job_fails tables, with Carbon casting for timestamps, array casting for payloads, and getters for payload keys like display_name, max_tries, command, and more.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

  • Architecture fit: The package provides two thin Eloquent models (Job, FailedJob) that map directly to Laravel’s default queue tables (jobs, failed_jobs). It aligns with Laravel’s ORM conventions and introduces no new architectural layers, making it a low-friction addition for applications already using the database queue driver. It is not suitable for Redis, SQS, or other non-database queue backends, nor does it replace full-featured queue management tools like Horizon.
  • Integration feasibility: Integration is straightforward: composer require repat/laravel-job-models, ensure the queue tables exist (via queue:table and queue:failed-table), and begin using the models. No configuration is required for default table names. The package is most valuable for internal tooling, debugging, and lightweight job observability where raw SQL queries would otherwise be needed.
  • Technical risk: Low-to-medium. The package is small and self-contained, but risks include: reliance on Laravel’s internal queue schema (which may change across major versions), assumptions about payload serializability (non-serializable payloads could cause errors), and a very small community (8 stars, 0 dependents) with limited external validation. The license is listed as NOASSERTION on the repository despite the README stating MIT, which may require legal review. Releases track Laravel versions up to Laravel 12, indicating active maintenance, but long-term support is not guaranteed.
  • Key questions:
    • Are we using Laravel’s database queue driver, and are the jobs/failed_jobs tables already present?
    • Which Laravel version are we on, and does the package’s compatibility matrix cover it?
    • Do we need job lifecycle events or advanced retry logic, or is read-only inspection sufficient?
    • Are our job payloads always JSON-serializable and in Laravel’s default structure?
    • Is the time saved by using this package (versus writing two simple models in-house) worth the dependency on a low-adoption package?
    • What is our internal support plan if the package becomes incompatible with a future Laravel release?

Integration Approach

  • Stack fit: Ideal for Laravel applications using MySQL, PostgreSQL, or SQLite database queues. It fits teams already comfortable with Eloquent and seeking to replace ad-hoc DB::table('jobs') queries with model-based access. It does not fit applications using Redis, SQS, or other non-database queue backends, nor teams already using Horizon for job management.
  • Migration path:
    1. Confirm prerequisites: run php artisan queue:table and php artisan queue:failed-table if not already done, then migrate.
    2. Install via Composer.
    3. Replace raw database queries with the provided models (e.g., Job::where('queue', 'default')->first()).
    4. Optionally extend the models with custom scopes or accessors for project-specific needs. The migration is incremental and low-risk; existing queue processing is unaffected.
  • Compatibility: Tested against Laravel 8 through 12 (per release notes). The package assumes default table names but the README implies it respects custom names defined in config/queue.php; this should be verified in a staging environment. Payload structure must match Laravel’s default (serialized command, data array). Custom queue schemas or non-standard payloads may require model overrides.
  • Sequencing:
    • Phase 1: Install and validate basic queries against a non-production environment.
    • Phase 2: Replace critical raw SQL queries in internal tools or debugging scripts.
    • Phase 3: Extend models with project-specific scopes (e.g., pending(), failedRecently()).
    • Phase 4: Monitor query performance and adjust indexing or query patterns as needed.

Operational Impact

  • Maintenance: Very low ongoing maintenance—no external services, no background processes. However, the package is a single-maintainer project with minimal community. Pin the version in composer.json and monitor Laravel release notes for queue schema changes. If the package becomes incompatible, the models are simple enough to fork or reimplement internally.
  • Support: Community support is minimal (8 stars, 0 dependents). Rely on internal documentation and a small test suite for critical queries. The MIT license (per README) permits forking and modification, but the NOASSERTION metadata may require legal clarification. Plan for a 30-minute onboarding session and a cheat sheet of common queries for the team.
  • Scaling: The models are read-only for inspection; they do not affect job creation or processing. However, frequent or heavy queries against the jobs table can add database load and potentially impact queue performance. Eloquent adds ~10–20% overhead versus raw SQL. Mitigate by using indexes, avoiding unbounded queries, and considering read replicas or separate analytics databases for high-frequency reporting.
  • Failure modes:
    • Payload unserialization errors if jobs contain non-serializable data (e.g., closures, resources).
    • Schema mismatches if custom table names or columns are used and not properly configured.
    • Breakage on Laravel upgrades if the queue table structure changes.
    • Silent failures or exceptions when accessing malformed payloads. Mitigations: validate payload structure in tests, verify custom configurations in staging, pin the package version, and monitor Laravel upgrade guides.
  • Ramp-up: Easy for Laravel developers—familiar Eloquent syntax and minimal learning curve. The README covers basic usage; supplement with internal examples for common tasks (e.g., “find stuck jobs”, “list failed jobs by exception”). Integration testing should cover critical queries against realistic payloads. No specialized training required beyond a short walkthrough.
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.
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table