Icon Visibility on Text Column depending on record value
I have a Text Column with a modal where I'm showing an Icon and Text. I'm able to hide the text depending on the status of the $record->StatusID from the model by using formatStateUsing() but the icon still shows. Is there a way to make the display of the icon conditional?
See code below.
Thank you!
5 Replies
Solution
sure, use a closure customization as well:
Wherever you can give a Field/Component's method a Closure, you can do this
and just for additional, I recommend to add your status value in your related model for readability π
e.g
const ORDER_STATUS_PAID = 4;
const ORDER_STATUS_SHIPPED = 5;
const ORDER_STATUS_DELIVERED = 6;
Or use an Enum
Thank you. That worked.