Skip to content

Commit

Permalink
Merge pull request #455 from MedicOneSystems/454-pass-params-to-render
Browse files Browse the repository at this point in the history
Column: introduce ability to pass custom data when using view()
  • Loading branch information
thyseus authored May 11, 2022
2 parents 141b6fd + ad757f5 commit cfcd9ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit cfcd9ce

Please sign in to comment.