Custom Icon Column
Trying to figure out what I am doing wrong here, I am viewing a User and want to show a checkmark on the user resource if they have a gallery item and they have verified their email. It is making the column but the column is blank.
5 Replies
You don’t have an Onboard field on the record, so it’s retuning null which will cause the column to not render. So you need to use ->getStateUsing() to return a non null value.
did a quick search for getStateUsing in docs and text column but can't find any examples
Sorry, try ->default() instead.
then inside ->default use the record to check the relationship ?
icon() should be an array where the key is the state. So, this case, it’d be
Icon will automatically read the state so no need to use a callback for it.
In this particular case though an attribute on the model might be easier unless you need to filter on the value.