From 6a0a25c0c578d145fbc76cfaa8fe0c8453ef13c5 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 1 Mar 2022 16:09:22 -0600 Subject: [PATCH] dynamically access batch options --- src/Illuminate/Bus/Batch.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Illuminate/Bus/Batch.php b/src/Illuminate/Bus/Batch.php index db8779d3acaa..d1464e442579 100644 --- a/src/Illuminate/Bus/Batch.php +++ b/src/Illuminate/Bus/Batch.php @@ -467,4 +467,15 @@ public function jsonSerialize() { return $this->toArray(); } + + /** + * Dynamically access the batch's "options" via properties. + * + * @param string $key + * @return mixed + */ + public function __get($key) + { + return $this->options[$key] ?? null; + } }