Typed property Filament\Forms\Components\Component::$container must not be accessed
Hi, i'm trying to hide a column with a Closure filter to hide it when it is null.
Code is the following
6 Replies
Hi @giuszeppe,
$get()
is meant to be used in the context of a form. You can do the same in a table with:
But in this case I'm not sure it makes sense to hide columns based on the value, because you'll end up with uneven columns in your table. Are you trying to show an empty value instead?What if I wanted to reduce code duplication?
I have many optional fields that I need to hide when null
I'm not sure what you mean, your example is showing a table column
Columns cannot be hidden like this on a per record basis. Html tables don’t support it. You can make a entire column toggleable which will sow or hide the column based on the users interaction.
I was just wondering if it is possible to have something like
->hidden(hideIfNull)
instead of rewriting every time the same logic.You could create a global helper function and pass in the state. This is still just laravel and php.