Yes, I need some custom component, which would be used in many components
I opened files vendor/filament/tables/src/Columns/TextColumn.php
and vendor/filament/tables/resources/views/columns/text-column.blade.php.
THey have a lot of code,especially the last file...
As I need to all functionality of TextColumn and add some functionality I modified in app/Tables/Columns/SummaryPointsPercent.php :
namespace App\Tables\Columns;
use Filament\Tables\Columns\Column;
use Filament\Tables\Columns\TextColumn;
class SummaryPointsPercent extends TextColumn
{
protected string $view = 'tables.columns.summary-points-percent';
}
So I extend my component from TextColumn.
Next I need to edit resources/views/tables/columns/summary-points-percent.blade.php file.
It has o lot of code.
a) I do not think that is a good idea to edit it - it is rather complicated.
b) If there is a way to edit / add code to source of my SummaryPointsPercent :
->getStateUsing(function (Model $record): string {
return UserQuizRequestHelper::getSummaryPointsPercent($record);
})
->icon(static fn(UserQuizRequest $record) => \Str::substrCount($record->summary_points_percent, '100%') === 1 ? UserQuizRequestHelper::get100PercentResultIcon() : '')
->tooltip(static fn(UserQuizRequest $record)
=> \Str::substrCount($record->summary_points_percent, '100%') ? '100 percent result' : '')
->iconPosition('after')
Not shure in which way I can do it...
I hope I explaned clear what I want...