feat: Cast MediaMonitoring channel to an enum and display it as a colored badge in the monitoring table.
This commit is contained in:
parent
a3f3842cc1
commit
3313f31048
@ -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')
|
||||
|
||||
@ -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,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user