diff --git a/events.md b/events.md
index 7ad8548f8b..9671f427bc 100644
--- a/events.md
+++ b/events.md
@@ -11,6 +11,8 @@
- [Queued Event Listeners](#queued-event-listeners)
- [Manually Interacting With the Queue](#manually-interacting-with-the-queue)
- [Queued Event Listeners and Database Transactions](#queued-event-listeners-and-database-transactions)
+ - [Queued Listener Middleware](#queued-listener-middleware)
+ - [Encrypted Queued Listeners](#encrypted-queued-listeners)
- [Handling Failed Jobs](#handling-failed-jobs)
- [Dispatching Events](#dispatching-events)
- [Dispatching Events After Database Transactions](#dispatching-events-after-database-transactions)
@@ -455,6 +457,62 @@ class SendShipmentNotification implements ShouldQueueAfterCommit
> [!NOTE]
> To learn more about working around these issues, please review the documentation regarding [queued jobs and database transactions](/docs/{{version}}/queues#jobs-and-database-transactions).
+
+### Queued Listener Middleware
+
+Queued listeners can also utilize [job middleware](/docs/{{version}}/queues#job-middleware). Job middleware allow you to wrap custom logic around the execution of queued listeners, reducing boilerplate in the listeners themselves. After creating job middleware, they may be attached to a listener by returning them from the listener's `middleware` method:
+
+```php
+
+ */
+ public function middleware(OrderShipped $event): array
+ {
+ return [new RateLimited];
+ }
+}
+```
+
+
+#### Encrypted Queued Listeners
+
+Laravel allows you to ensure the privacy and integrity of a queued listener's data via [encryption](/docs/{{version}}/encryption). To get started, simply add the `ShouldBeEncrypted` interface to the listener class. Once this interface has been added to the class, Laravel will automatically encrypt your listener before pushing it onto a queue:
+
+```php
+
### Handling Failed Jobs
@@ -557,7 +615,7 @@ If you require more complex logic for determining the listeners's backoff time,
/**
* Calculate the number of seconds to wait before retrying the queued listener.
*/
-public function backoff(): int
+public function backoff(OrderShipped $event): int
{
return 3;
}
@@ -571,12 +629,101 @@ You may easily configure "exponential" backoffs by returning an array of backoff
*
* @return list
*/
-public function backoff(): array
+public function backoff(OrderShipped $event): array
{
return [1, 5, 10];
}
```
+
+#### Specifying Queued Listener Max Exceptions
+
+Sometimes you may wish to specify that a queued listener may be attempted many times, but should fail if the retries are triggered by a given number of unhandled exceptions (as opposed to being released by the `release` method directly). To accomplish this, you may define a `maxExceptions` property on your listener class:
+
+```php
+
+#### Specifying Queued Listener Timeout
+
+Often, you know roughly how long you expect your queued listeners to take. For this reason, Laravel allows you to specify a "timeout" value. If a listener is processing for longer than the number of seconds specified by the timeout value, the worker processing the listener will exit with an error. You may define the maximum number of seconds a listener should be allowed to run by defining a `$timeout` property on your listener class:
+
+```php
+
## Dispatching Events