Why is my Action visible?
Hi,
I have a InfoList with an action, but why is my action button (edit:not) visible? I dumped $record and the $record->status is 'running'.
The action button should not be visible...
Solution:Jump to solution
Thank you guys! I found my mistake... I forgot that
status
is an ENUM. Thanks to your help I was able to fix it:
->visible(fn ($record) => $record->status === InstanceStatus::RUNNING)
...8 Replies
You literally instruct it to be visible when status is running.
Oh sorry... my text was wrong... I mean "Why is my action button not visible".... My mistake.
So with the code above the action button is not visible...
And
status
is a string? The value is not changed during the page visit but is running
already when you visit that page.Yes. Status is a string.
And I am Not changing that value in the visit site
Are you sure it is showing
running
?
What is the output?Solution
Thank you guys! I found my mistake... I forgot that
status
is an ENUM. Thanks to your help I was able to fix it:
->visible(fn ($record) => $record->status === InstanceStatus::RUNNING)
That’s why I asked whether it’s a string 😅
you are so right 😁 I only checked the database field and not my actual code. I sorry. You guys rock!