From 7d87f34ca44c7cb24c42dca3c153ff19fbc11501 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Mon, 4 Jul 2022 04:21:31 +0800 Subject: [PATCH] admin torrent field separate --- app/Filament/Resources/Torrent/TorrentResource.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/app/Filament/Resources/Torrent/TorrentResource.php b/app/Filament/Resources/Torrent/TorrentResource.php index 68774438..c0debe0c 100644 --- a/app/Filament/Resources/Torrent/TorrentResource.php +++ b/app/Filament/Resources/Torrent/TorrentResource.php @@ -55,24 +55,18 @@ class TorrentResource extends Resource return $table ->columns([ Tables\Columns\TextColumn::make('id')->sortable(), - Tables\Columns\BadgeColumn::make('basic_category.name')->label(__('label.torrent.category')), + Tables\Columns\TextColumn::make('basic_category.name')->label(__('label.torrent.category')), Tables\Columns\TextColumn::make('name')->formatStateUsing(function (Torrent $record) { - $sticky = sprintf( - '
%s
', - $record->posStateText - ); $name = sprintf( '
%s
', Str::limit($record->name, 40) ); - $promotion = sprintf( - '
%s
', - $record->spStateText - ); $tags = sprintf('
%s
', $record->tagsFormatted); - return new HtmlString('
' . $sticky . $name . $promotion . $tags . '
'); + return new HtmlString('
' . $name . $tags . '
'); }), + Tables\Columns\TextColumn::make('posStateText')->label(__('label.torrent.pos_state')), + Tables\Columns\TextColumn::make('spStateText')->label(__('label.torrent.sp_state')), Tables\Columns\TextColumn::make('size')->label(__('label.torrent.size'))->formatStateUsing(fn ($state) => mksize($state)), Tables\Columns\TextColumn::make('seeders')->label(__('label.torrent.seeders')), Tables\Columns\TextColumn::make('leechers')->label(__('label.torrent.leechers')),