`visible()` method doesn't work right with === check.
Here is the code snippet I have
If I use
===
to check the visible condition, it doesn't work. But the same works with ==
. Am i missing something? The key's on the Select fields are integer and I am checking against an integer.3 Replies
it is likely when retrieved the value back from the html select is returned as string
can easily solve by
->visible(fn(\Closure $get) => (int) $get('table_style') == 0),
ok
You need to type cast, $get pulls all strings, so you would need to either (int) or quote the number so it's string to string.