Andrew 2 달 전
부모
커밋
c64b2ccc73
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 4
    3
      app/Filament/Resources/BannerResource.php

+ 4
- 3
app/Filament/Resources/BannerResource.php 파일 보기

104
                         '1' => 'heroicon-o-photo',
104
                         '1' => 'heroicon-o-photo',
105
                         '2' => 'heroicon-o-film',
105
                         '2' => 'heroicon-o-film',
106
                     }),
106
                     }),
107
-                ImageColumn::make('img_url')->label('圖片')->getStateUsing(fn($record) => $record->type == 1 ? $record->img_url : null),
107
+                ImageColumn::make('img_url')->label('圖片')
108
+                    ->getStateUsing(fn($record) => $record->type == 1 ? $record->img_url : null),
108
                 TextColumn::make('title')->label('標題')
109
                 TextColumn::make('title')->label('標題')
109
-                    ->formatStateUsing(fn($record, $state) => $record->type == 1 ? $state : '-'),
110
+                    ->getStateUsing(fn($record) => $record->type == 1 ? $record->title : null),
110
                 TextColumn::make('video_url')->label('影片網址')
111
                 TextColumn::make('video_url')->label('影片網址')
111
-                    ->formatStateUsing(fn($record, $state) => $record->type == 2 ? $state : '-'),
112
+                    ->formatStateUsing(fn($record) => $record->type == 2 ? $record->video_url : null),
112
             ])
113
             ])
113
             ->filters([
114
             ->filters([
114
                 //
115
                 //