I've made some change to accept media (I'm using curator plugin) and what i want to achieve is a conditional column
If the type of my setting is media i want a CuratorColumn. For everything else a TextColumn but i don't know how to make this
return $table ->columns([ Tables\Columns\TextColumn::make('label') ->sortable() ->searchable(), // If the type is "media" make a CuratorColumn on value CuratorColumn::make('value') ->circular(), // Else make a TextColumn on value Tables\Columns\TextColumn::make('value') ->formatStateUsing(function ($state) { return match ($state) { null => 'Empty', "0" => 'False', "1" => 'True', default => 'OK' }; }) ->sortable() ->searchable(), ])
return $table ->columns([ Tables\Columns\TextColumn::make('label') ->sortable() ->searchable(), // If the type is "media" make a CuratorColumn on value CuratorColumn::make('value') ->circular(), // Else make a TextColumn on value Tables\Columns\TextColumn::make('value') ->formatStateUsing(function ($state) { return match ($state) { null => 'Empty', "0" => 'False', "1" => 'True', default => 'OK' }; }) ->sortable() ->searchable(), ])