ColumnSpan : Array to string conversion
Hello everyone,
Is it only me who has this problem when I try to make my columns dynamic on any of my fields, I get the following error if I try to return an array from a closure:
Array to string conversion
Here is my code:
Whereas if I pass it an array directly without closure, I have no error. Is this a bug? Or am I the only one getting this problem?
5 Replies
What is $get(‘show_time’) returning? If it’s anything other than true/false/null it will break your ternary.
it's a Toggle and it returns true or false. I have the same error with :
and not error with :
So it's not the condition but I think it's the Closure...
Sorry. Not sure then. Your code looks correct and the columnSpan method accepts a closure.
Is this in a resource or a stand alone form.
In a stand alone form, I tested in multi forms and I have the same error. Can you try in your app if this code on any field returns an error?
I suspect a code bug in Filament or my entire application...
Thank's for help!
Make sure you are calling $this->form->fill() in the mount() method