<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/queue-totalsize-and-jobinterrupted-event-in-laravel-13-31-chrjuzcn5" -->

---
title: Queue totalSize() and JobInterrupted Event in Laravel 13.31
description: Laravel 13.31.0 introduces a Queue::totalSize() method that combines pending, delayed, and reserved job counts for a queue connection, plus a new...
canonical: https://daily.dev/posts/queue-totalsize-and-jobinterrupted-event-in-laravel-13-31-chrjuzcn5
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Queue totalSize() and JobInterrupted Event in Laravel 13.31 | daily.dev
og:description: Laravel 13.31.0 introduces a Queue::totalSize() method that combines pending, delayed, and reserved job counts for a queue connection, plus a new...
og:url: https://daily.dev/posts/queue-totalsize-and-jobinterrupted-event-in-laravel-13-31-chrjuzcn5
og:image: https://api.daily.dev/og/posts/CHrjUZcn5.png
og:image:alt: Queue totalSize() and JobInterrupted Event in Laravel 13.31
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Queue totalSize() and JobInterrupted Event in Laravel 13.31

**[Laravel News](https://daily.dev/sources/ln)** · 5 min read · 0 upvotes · 0 comments

## Summary

Laravel 13.31.0 introduces a Queue::totalSize() method that combines pending, delayed, and reserved job counts for a queue connection, plus a new JobInterrupted event fired when an Interruptible job is stopped by a worker, allowing cleanup or logging hooks. The release also adds chaperone() support for BelongsToMany pivot models so custom pivot classes can access already-hydrated related models without extra database queries, a devServerUrl() method on the Vite class for retrieving the dev server URL, and new assertSentOnce/assertQueuedOnce-style assertions for Mail and Notification fakes. Numerous bug fixes are included, covering Redis cluster safety, lazy()/lazyById() limit handling, RateLimited middleware, wherePivot() closure scope, and more.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://laravel-news.com/laravel-13-31-0>

## Questions this post answers

### How do I get the total number of jobs across a Laravel queue connection?

Laravel 13.31.0 adds a Queue::totalSize() method that returns the combined count of pending, delayed, and reserved jobs on a queue connection. Previously this required manually summing Queue::totalPendingSize(), Queue::totalDelayedSize(), and Queue::totalReservedSize() separately. It was contributed by Jack Bayliss in pull request #61373.

_daily.dev surfaces framework release notes like this queue update for developers tracking Laravel changes._

### How can I detect when a Laravel queue worker interrupts a running job?

Laravel 13.31.0 introduces a JobInterrupted event that fires when a job implementing the Interruptible contract is stopped by the worker, letting you listen for Illuminate\Queue\Events\JobInterrupted and run cleanup or logging logic in response. It was contributed by Jack Bayliss in pull request #61412.

_Developers building resilient queue workers can follow Laravel updates like this on daily.dev._

### How does chaperone() work with a custom BelongsToMany pivot model in Laravel?

As of Laravel 13.31.0, chaperone() support extends to BelongsToMany relations using custom pivot models, so BelongsTo relations defined on the pivot (like post() and tag() on a PostTagPivot) can resolve using models already loaded during hydration instead of querying the database again. It automatically guesses relationship names or accepts explicit declaring and related arguments, and is a no-op without a custom pivot model. Contributed by Caleb White in pull request #61152.

_daily.dev helps Laravel developers keep up with Eloquent relationship changes like chaperone support._

## Similar posts on daily.dev

- [Interruptible Jobs in Laravel 13.7.0](https://daily.dev/posts/interruptible-jobs-in-laravel-13-7-0-mfdtpjnvt) · Laravel News · 53 upvotes · 4 comments
- [Queue-Wide Inspection Methods in Laravel 13.8.0](https://daily.dev/posts/queue-wide-inspection-methods-in-laravel-13-8-0-hgzecxgmv) · Laravel News · 19 upvotes · 0 comments
- [Debounceable Queued Jobs in Laravel 13.6.0](https://daily.dev/posts/debounceable-queued-jobs-in-laravel-13-6-0-po9ifu40t) · Laravel News · 26 upvotes · 2 comments

---

Tags: [#testing](https://daily.dev/tags/testing), [#php](https://daily.dev/tags/php), [#laravel](https://daily.dev/tags/laravel)

[View this post on daily.dev](https://daily.dev/posts/queue-totalsize-and-jobinterrupted-event-in-laravel-13-31-chrjuzcn5)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Queue totalSize() and JobInterrupted Event in Laravel 13.31","url":"https://daily.dev/posts/queue-totalsize-and-jobinterrupted-event-in-laravel-13-31-chrjuzcn5","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/queue-totalsize-and-jobinterrupted-event-in-laravel-13-31-chrjuzcn5"},"datePublished":"2026-09-09T13:38:45.554Z","dateModified":"2026-09-13T18:35:31.906Z","description":"Laravel 13.31.0 introduces a Queue::totalSize() method that combines pending, delayed, and reserved job counts for a queue connection, plus a new...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ee40e2048594e45913dd31bd66f36e1c?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ee40e2048594e45913dd31bd66f36e1c?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Laravel News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Laravel News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/ln","url":"https://daily.dev/sources/ln"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/queue-totalsize-and-jobinterrupted-event-in-laravel-13-31-chrjuzcn5","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"testing,php,laravel","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Laravel News","item":"https://daily.dev/sources/ln"},{"@type":"ListItem","position":3,"name":"Queue totalSize() and JobInterrupted Event in Laravel 13.31"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/queue-totalsize-and-jobinterrupted-event-in-laravel-13-31-chrjuzcn5#faq","mainEntity":[{"@type":"Question","name":"How do I get the total number of jobs across a Laravel queue connection?","acceptedAnswer":{"@type":"Answer","text":"Laravel 13.31.0 adds a Queue::totalSize() method that returns the combined count of pending, delayed, and reserved jobs on a queue connection. Previously this required manually summing Queue::totalPendingSize(), Queue::totalDelayedSize(), and Queue::totalReservedSize() separately. It was contributed by Jack Bayliss in pull request #61373. daily.dev surfaces framework release notes like this queue update for developers tracking Laravel changes."}},{"@type":"Question","name":"How can I detect when a Laravel queue worker interrupts a running job?","acceptedAnswer":{"@type":"Answer","text":"Laravel 13.31.0 introduces a JobInterrupted event that fires when a job implementing the Interruptible contract is stopped by the worker, letting you listen for Illuminate\\Queue\\Events\\JobInterrupted and run cleanup or logging logic in response. It was contributed by Jack Bayliss in pull request #61412. Developers building resilient queue workers can follow Laravel updates like this on daily.dev."}},{"@type":"Question","name":"How does chaperone() work with a custom BelongsToMany pivot model in Laravel?","acceptedAnswer":{"@type":"Answer","text":"As of Laravel 13.31.0, chaperone() support extends to BelongsToMany relations using custom pivot models, so BelongsTo relations defined on the pivot (like post() and tag() on a PostTagPivot) can resolve using models already loaded during hydration instead of querying the database again. It automatically guesses relationship names or accepts explicit declaring and related arguments, and is a no-op without a custom pivot model. Contributed by Caleb White in pull request #61152. daily.dev helps Laravel developers keep up with Eloquent relationship changes like chaperone support."}}]}
```

