feat: Cast MediaMonitoring channel to an enum and display it as a colored badge in the monitoring table.

This commit is contained in:
Yoga Pangestu 2026-03-16 22:54:20 +07:00
parent a3f3842cc1
commit 3313f31048
2 changed files with 5 additions and 1 deletions

View File

@ -48,7 +48,9 @@ public static function configure(Table $table): Table
TextColumn::make('channel')
->label('Kanal')
->searchable()
->sortable(),
->sortable()
->badge()
->color(fn (Channel $state): string => $state->getColor()),
TextColumn::make('writter')
->label('Penulis')

View File

@ -2,6 +2,7 @@
namespace App\Models;
use App\Enums\Channel;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
@ -22,6 +23,7 @@ protected function casts(): array
{
return [
'release_date' => 'date',
'channel' => Channel::class,
];
}