table column visibility base on record
I am trying to set the table column visibility base on some record, but it's showing error
What I've tried:
But the same function for
My code which is working for action:
So, what should be the error here?
Argument #1 ($record) must be of type App\Models\Candidate, null givenWhat I've tried:
But the same function for
->visible() is working fine in actionsMy code which is working for action:
So, what should be the error here?
Solution
This was asked quite some times here. You cannot hide table columns based on a record, because that would result in a bad table layout.