Laravel 13.18: Worker Metrics &amp; More | Mohamed Said       [Skip to content](#main)  [ ![](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png) Mohamed SaidLaravel Backend Engineer ](https://www.msaied.com/public) - [Home](https://www.msaied.com/public)
- [Projects](https://www.msaied.com/public/projects)
- [Articles](https://www.msaied.com/public/articles)
- [Certificates](https://www.msaied.com/public/certificates)
- [About](https://www.msaied.com/public#about)

           [  Contact](https://www.msaied.com/public#contact) Menu 

Menu
----

Close 

 - [HomeStart here](https://www.msaied.com/public)
- [ProjectsCase studies](https://www.msaied.com/public/projects)
- [ArticlesEngineering notes](https://www.msaied.com/public/articles)
- [CertificatesCredentials](https://www.msaied.com/public/certificates)
- [AboutHow I work](https://www.msaied.com/public#about)
- [ContactGet in touch](https://www.msaied.com/public#contact)

  [Start a conversation](https://www.msaied.com/public#contact) [WhatsApp](https://wa.me/201094619204) [Email](mailto:hello@msaied.com) 

 1. [Home](https://www.msaied.com/public)
2. /
3. [Articles](https://www.msaied.com/public/articles)
4. /
5. [Laravel](https://www.msaied.com/public/articles?category=laravel)
6. /
7. Worker Metrics on the WorkerStopping Event in Laravel 13.18

   [Laravel](https://www.msaied.com/public/articles?category=laravel) 

 Worker Metrics on the WorkerStopping Event in Laravel 13.18
============================================================

 Laravel 13.18 adds worker metrics to the WorkerStopping event, graceful signal handling for schedule:work, priority-based artisan dev command registration, and fixes for Number helpers, cache, and the scheduler.

 ![](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp) [Mohamed Said](https://www.msaied.com/public#person) Published 1 Jul 2026 · Updated 1 Jul 2026 · 3 min read

ShareCopy linkCopied

 ![Worker Metrics on the WorkerStopping Event in Laravel 13.18](https://cdn.msaied.com/338/11a987dabe96024609cdd3bdb669c33c.png) 

  On this page +1. [What's New in Laravel 13.18](#whats-new-in-laravel-1318)
2. [Worker Metrics on the WorkerStopping Event](#worker-metrics-on-the-codeworkerstoppingcode-event)
3. [Graceful Shutdown for schedule:work](#graceful-shutdown-for-codescheduleworkcode)
4. [Priority-Based Dev Command Registration](#priority-based-dev-command-registration)
5. [Number Helpers Hardened Against INF and NAN](#number-helpers-hardened-against-inf-and-nan)
6. [Other Fixes and Improvements](#other-fixes-and-improvements)
7. [Key Takeaways](#key-takeaways)

 What's New in Laravel 13.18
---------------------------

Laravel 13.18.0 ships a focused set of improvements across the queue worker, scheduler, Artisan dev commands, and Number helpers, alongside a batch of targeted bug fixes.

### Worker Metrics on the `WorkerStopping` Event

The `WorkerStopping` event now exposes two new properties that describe what a worker did before it shut down:

- **`jobsProcessed`** (`int|null`) — the total number of jobs the worker handled during its lifetime.
- **`lastJobProcessedAt`** (`int|float|null`) — a microtime timestamp of the last job processed, or `null` if the worker stopped before processing anything.

```php
use Illuminate\Queue\Events\WorkerStopping;

Event::listen(function (WorkerStopping $event) {
    $event->jobsProcessed;      // int|null
    $event->lastJobProcessedAt; // int|float|null (microtime)
});

```

Both values are populated whether the worker exits normally or is killed. This gives you a clean hook to record per-worker throughput or emit metrics to an observability platform when a daemon exits, without instrumenting the job loop yourself.

> PRs: [\#60592](https://github.com/laravel/framework/pull/60592) and [\#60608](https://github.com/laravel/framework/pull/60608)

### Graceful Shutdown for `schedule:work`

`schedule:work` now catches `SIGINT`, `SIGTERM`, and `SIGQUIT`. On receiving one of these signals it stops scheduling new runs and waits for any in-progress `schedule:run` to finish before exiting — mirroring the existing behavior of `queue:work`.

This is particularly relevant in container environments like Kubernetes, where pods receive `SIGTERM` on shutdown. Previously, that signal could interrupt a task mid-execution.

> PR: [\#60616](https://github.com/laravel/framework/pull/60616)

### Priority-Based Dev Command Registration

Dev commands registered for `artisan dev` now carry a source priority: userland application commands win over vendor package commands, which win over framework defaults — regardless of service provider boot order.

```php
use Illuminate\Foundation\Console\DevCommands;

DevCommands::artisan('reverb:start --host="0.0.0.0"', 'reverb');

```

This replaces the previous vendor auto-registration blocker approach with explicit priority, so your overrides always take effect. Additionally, `artisan dev` now runs with `--kill-others-on-fail`, meaning if one process in the group fails, the rest are stopped rather than left running.

> PRs: [\#60580](https://github.com/laravel/framework/pull/60580) and [\#60606](https://github.com/laravel/framework/pull/60606)

### Number Helpers Hardened Against INF and NAN

`Number::forHumans()`, `Number::abbreviate()`, and `Number::fileSize()` previously threw exceptions when passed `INF` or `NAN`. All three are now fixed to handle these edge-case inputs without crashing.

> PRs: [\#60617](https://github.com/laravel/framework/pull/60617) and [\#60625](https://github.com/laravel/framework/pull/60625)

### Other Fixes and Improvements

- Reduced unnecessary cache hits when using debounced jobs ([\#60575](https://github.com/laravel/framework/pull/60575))
- Fixed cache headers not being set on HEAD requests ([\#60589](https://github.com/laravel/framework/pull/60589))
- Prevented the `restored` event from firing when a soft-delete restore fails ([\#60605](https://github.com/laravel/framework/pull/60605))
- Fixed `RateLimited` middleware not serializing `releaseAfter` in `__sleep()` ([\#60609](https://github.com/laravel/framework/pull/60609))
- Fixed `flexible()` lock and defer label collisions in `TaggedCache` ([\#60626](https://github.com/laravel/framework/pull/60626))
- Fixed JSON parsing for top-level zero bodies ([\#60614](https://github.com/laravel/framework/pull/60614))
- Added conditional return types and synced getter return types with property generics

Key Takeaways
-------------

- Listen to `WorkerStopping` to capture per-worker job counts and last-processed timestamps without custom instrumentation.
- `schedule:work` now handles `SIGTERM` gracefully — important for Kubernetes and other container runtimes.
- Userland `artisan dev` command registrations always win over vendor and framework defaults via explicit priority.
- `Number::forHumans()`, `Number::abbreviate()`, and `Number::fileSize()` no longer crash on `INF` or `NAN` inputs.
- Several cache, scheduler, and middleware edge-case bugs are resolved in this release.

---

*Source: [Laravel News — Laravel 13.18.0](https://laravel-news.com/laravel-13-18-0)*

- [Laravel](https://www.msaied.com/public/articles?search=Laravel)
- [Queue](https://www.msaied.com/public/articles?search=Queue)
- [Scheduler](https://www.msaied.com/public/articles?search=Scheduler)
- [Artisan](https://www.msaied.com/public/articles?search=Artisan)
- [Laravel 13](https://www.msaied.com/public/articles?search=Laravel%2013)

 Frequently asked questions 
---------------------------

  What new data does the WorkerStopping event expose in Laravel 13.18?The WorkerStopping event now includes two properties: `jobsProcessed` (the number of jobs handled during the worker's lifetime) and `lastJobProcessedAt` (a microtime timestamp of the final job processed, or null if no jobs were processed).

   Why does graceful shutdown for schedule:work matter in Kubernetes?Kubernetes sends SIGTERM to pods during shutdown. Before Laravel 13.18, schedule:work did not catch this signal, so an in-progress scheduled task could be interrupted mid-execution. Now it waits for the current run to finish before exiting.

   How does priority-based dev command registration work in artisan dev?Commands registered for artisan dev are assigned a priority based on their source: application-level registrations take precedence over vendor package registrations, which take precedence over framework defaults. This ensures your overrides always win regardless of service provider boot order.

   ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)About the author
----------------

[Mohamed Said](https://www.msaied.com/public#person)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

[About](https://www.msaied.com/public#about) [GitHub ↗](https://github.com/EG-Mohamed) [LinkedIn ↗](https://www.linkedin.com/in/msaiedm/) [WhatsApp ↗](https://wa.me/201094619204) [Email Address ↗](mailto:hello@msaied.com) [My CV ↗](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)  

   [Previous articleMulti-Tenant SaaS: Scoping Filament v3 Resources to the Current Tenant](https://www.msaied.com/public/articles/multi-tenant-saas-scoping-filament-v3-resources-to-the-current-tenant) [Next articleProfiling Laravel with Blackfire and Xdebug: Finding Real Bottlenecks](https://www.msaied.com/public/articles/profiling-laravel-with-blackfire-and-xdebug-finding-real-bottlenecks)  

   On this page
-------------

1. [What's New in Laravel 13.18](#whats-new-in-laravel-1318)
2. [Worker Metrics on the WorkerStopping Event](#worker-metrics-on-the-codeworkerstoppingcode-event)
3. [Graceful Shutdown for schedule:work](#graceful-shutdown-for-codescheduleworkcode)
4. [Priority-Based Dev Command Registration](#priority-based-dev-command-registration)
5. [Number Helpers Hardened Against INF and NAN](#number-helpers-hardened-against-inf-and-nan)
6. [Other Fixes and Improvements](#other-fixes-and-improvements)
7. [Key Takeaways](#key-takeaways)

 ###  Have a technical challenge?

 Tell me what you’re building. I reply within two working days.

[Start a conversation](https://www.msaied.com/public#contact) 

   Related articles
-----------------

 [ ![](https://cdn.msaied.com/740/cce86edc21eddcbdd2f2454fadaf9c70.png)  · 3 min read### The Pipeline Pattern in Laravel: Custom Pipelines Beyond Middleware

5 Oct 2026 ](https://www.msaied.com/public/articles/the-pipeline-pattern-in-laravel-custom-pipelines-beyond-middleware-1) [ ![](https://cdn.msaied.com/739/2d6897fdcdcf090613f96f72a64b8a78.png)  · 4 min read### MySQL Full-Text Search in Laravel: Indexes, Relevance Scoring, and Boolean Mode

4 Oct 2026 ](https://www.msaied.com/public/articles/mysql-full-text-search-in-laravel-indexes-relevance-scoring-and-boolean-mode) [ ![](https://cdn.msaied.com/738/073696a3fefe18bec825beec5ac658f5.png)  · 4 min read### Laravel Queue Rate-Limited Middleware: Throttling Jobs Without Losing Work

4 Oct 2026 ](https://www.msaied.com/public/articles/laravel-queue-rate-limited-middleware-throttling-jobs-without-losing-work) 

  Have a technical challenge?
----------------------------

Tell me what you’re building. I reply within two working days.

 [Discuss your project ↗](https://www.msaied.com/public#contact) 

  © 2026 Mohamed Said · Built with Laravel, meant to last.Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

 - [Home](https://www.msaied.com/public)
- [Articles](https://www.msaied.com/public/articles)
- [Certificates](https://www.msaied.com/public/certificates)
- [GitHub](https://github.com/EG-Mohamed)
- [LinkedIn](https://www.linkedin.com/in/msaiedm/)
- [WhatsApp](https://wa.me/201094619204)
- [Email Address](mailto:hello@msaied.com)
- [My CV](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
- [Sitemap](https://www.msaied.com/public/sitemap.xml)
