feat: display partner media names as badges in the announcement table using custom state retrieval.
This commit is contained in:
parent
0c2784d82a
commit
ca912e5d6a
@ -116,12 +116,18 @@ public static function table(Table $table): Table
|
|||||||
->badge()
|
->badge()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
|
|
||||||
TextColumn::make('partnerMedia.name')
|
TextColumn::make('partnerMedia')
|
||||||
->label('Penerima')
|
->label('Penerima')
|
||||||
|
->getStateUsing(
|
||||||
|
fn ($record) => $record->partnerMedia->pluck('name')->toArray()
|
||||||
|
)
|
||||||
->listWithLineBreaks()
|
->listWithLineBreaks()
|
||||||
->limitList(3)
|
->limitList(3)
|
||||||
->expandableLimitedList()
|
->expandableLimitedList()
|
||||||
->placeholder(fn (Announcement $record): string => $record->type === AnnouncementType::PUBLIC ? 'Publik' : 'Tidak ada penerima'),
|
->badge()
|
||||||
|
->placeholder(
|
||||||
|
fn (Announcement $record) => $record->type === AnnouncementType::PUBLIC ? 'Publik' : 'Tidak ada penerima'
|
||||||
|
),
|
||||||
|
|
||||||
...TimestampColumns::make(),
|
...TimestampColumns::make(),
|
||||||
])
|
])
|
||||||
|
|||||||
@ -691,18 +691,6 @@ public function run(): void
|
|||||||
"name": "Perusahaan",
|
"name": "Perusahaan",
|
||||||
"guard_name": "web",
|
"guard_name": "web",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"ViewAny:Announcement",
|
|
||||||
"View:Announcement",
|
|
||||||
"Create:Announcement",
|
|
||||||
"Update:Announcement",
|
|
||||||
"Delete:Announcement",
|
|
||||||
"Restore:Announcement",
|
|
||||||
"ForceDelete:Announcement",
|
|
||||||
"ForceDeleteAny:Announcement",
|
|
||||||
"RestoreAny:Announcement",
|
|
||||||
"Replicate:Announcement",
|
|
||||||
"Reorder:Announcement",
|
|
||||||
|
|
||||||
"ViewAny:Cooperation",
|
"ViewAny:Cooperation",
|
||||||
"View:Cooperation",
|
"View:Cooperation",
|
||||||
"Create:Cooperation",
|
"Create:Cooperation",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user