The problem that I've encounter is when I wanted to include additional data variable to be used in the view file rendered by the ->addColumn('action', 'path.to.action.view')
I understand that there are already data being passed to the view file. These data are the selected columns from the DB.
Looking at the builder.php file, is it unclear to me how additional data can be passed in.
public function addColumn(array $attributes)
{
$this->collection->push(new Column($attributes));
return $this;
}
You can use closure if you want to pass more variables in the view like:
->addColumn('action', function($row) {
$var = 'test';
return view('path.to.action.view', compact('row', 'var')->render();
})
Thank you for the fast response. I've got the problem solved thanks to you.
Cheers.
Most helpful comment
You can use closure if you want to pass more variables in the view like: