From e6da0b8a7485276faad228e1270e6987f9fa888e Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Mon, 7 Mar 2022 23:02:42 +0800 Subject: [PATCH] dynamically access batch options (#41361) Co-authored-by: Taylor Otwell --- 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; + } }