How to access Model $record when using ->visible() or ->hidden()?
This is not working
i am getting this error:
10 Replies
try like this
fn(?User $record)
I'm getting
Call to a member function verified() on null
hmmm, I think I'm implementing the wrong way. the hidden/visible function of TextColumn is to hide everything from that column.What is the planning/requirement here.. it seems like you try to hide/show table column based on email_verified (which is bad UI)
Why not just display
true
false
based on whether it's null or not (good UI)Yea you are right.
ok.. then just do
TextColumn::make('email_verified_at')->placeholder('Nah')
🤣Nah.. it's table.. not form, and showing/hiding column per something is a bad UI/UX
As VP mentioned this is not possible because it doesn’t make sense to show/hide Columns on a row level
I don't think it's a bad UI design. Sometime, we would like to show some fields according to the record type... in the same grid... like an activity log.
Date, action, info related to that action...
I've found this... I'll try it