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.
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.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.jobs/failed_jobs tables already present?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.php artisan queue:table and php artisan queue:failed-table if not already done, then migrate.Job::where('queue', 'default')->first()).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.pending(), failedRecently()).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.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.How can I help you explore Laravel packages today?