colorful
Some checks failed
Tests / PHP 8.3 (push) Has been cancelled
Tests / PHP 8.4 (push) Has been cancelled
Tests / PHP 8.5 (push) Has been cancelled

This commit is contained in:
2026-05-01 12:54:12 +00:00
parent 6ef2e9fe4e
commit 7c5055075b
12 changed files with 128 additions and 26 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Filament\Resources\FeedbackChannels\Schemas;
use Filament\Forms\Components\ColorPicker;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Schemas\Components\Section;
@@ -25,6 +26,8 @@ class FeedbackChannelForm
TextInput::make('icon')
->maxLength(255)
->hint('Heroicon name or emoji'),
ColorPicker::make('color')
->label('Color'),
Toggle::make('is_active')
->default(true),
])

View File

@@ -17,9 +17,23 @@ class FeedbackChannelsTable
->columns([
TextColumn::make('name')
->searchable()
->sortable(),
->sortable()
->formatStateUsing(fn ($state, $record) => sprintf(
'<span style="display:inline-block;background:%s;color:#fff;padding:2px 10px;border-radius:9999px;font-size:0.75rem;">%s</span>',
$record->color ?: '#6b7280',
e($state)
))
->html(),
TextColumn::make('slug')
->searchable(),
TextColumn::make('color')
->label('Color')
->formatStateUsing(fn ($state) => sprintf(
'<span style="display:inline-block;width:24px;height:24px;background:%s;border-radius:6px;border:1px solid #d1d5db;" title="%s"></span>',
$state ?: '#6b7280',
$state
))
->html(),
IconColumn::make('is_active')
->boolean()
->label('Active'),