Open alexandergziresis opened 2 years ago
Refer to the Relation example.
So, in the columns method, you can write Column::callback(['roles.name'], closure())
, and at the bottom of the file (or anywhere) add the getRolesProperty()
method.
Example code:
public function columns()
{
return [
Column::callback(['roles.name']), function($role_name) {
return $role_name;
}),
];
}
public function getRolesProperty()
{
Roles::all();
}
Tell me if you have any issues.
Hello!, when i try pass a relationship variable in a callback i get an error (example roles.name), but in a simple column works fine