Tooltip available only if return has value.
On my table, I have this code to show a tooltip.
If the record has been marked READY the tooltip shows, eg:
Marked READY at: 2023-08-01 15:34:00
But if the record has not yet been marked as READY (null), the tooltip shows:
Marked READY at:
I would like to have the tooltip available only when there is a date/time to show up.
Is there anything to show the tooltip only when the return data is not null?
Thank you.
3 Replies
Solution
: ?string => $record->marked_ready_at ? 'xxx' : null
?Thank you @leandro_ferreira ,
Following your advice...
It works nicely.
I hope you don't mind...
I hope I'm learning the right way.
The first "?" is there to check if a value type string is returned (date/time cast)
The second "?" is there working with ":" checking if the value is returned, if yes I show my text and date/time otherwise empty
Correct?
Thank you.
the second was the question π