From ad757f50a0738a6696a9ad0a2aa89bc7bdd307d0 Mon Sep 17 00:00:00 2001 From: David Grosse Date: Mon, 9 May 2022 15:11:13 +0200 Subject: [PATCH] Column: introduce ability to pass custom data when using view() --- src/Column.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Column.php b/src/Column.php index 7361990b..58389957 100644 --- a/src/Column.php +++ b/src/Column.php @@ -350,10 +350,10 @@ public function round($precision = 0) return $this; } - public function view($view) + public function view($view, $data = []) { - $this->callback = function ($value, $row) use ($view) { - return view($view, ['value' => $value, 'row' => $row]); + $this->callback = function ($value, $row) use ($view, $data) { + return view($view, ['value' => $value, 'row' => $row, ...$data]); }; $this->exportCallback = function ($value) {