Andrew 2 месяцев назад
Родитель
Сommit
ae98d5cf89
1 измененных файлов: 6 добавлений и 3 удалений
  1. 6
    3
      app/Filament/Resources/BannerResource.php

+ 6
- 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('圖片'),
108
-                TextColumn::make('title')->label('標題'),
109
-                TextColumn::make('video_url')->label('影片網址'),
107
+                ImageColumn::make('img_url')->label('圖片')
108
+                    ->visible(fn ($record): bool => $record->type == 1),
109
+                TextColumn::make('title')->label('標題')
110
+                    ->visible(fn ($record): bool => $record->type == 1),
111
+                TextColumn::make('video_url')->label('影片網址')
112
+                    ->visible(fn ($record): bool => $record->type == 2),
110
             ])
113
             ])
111
             ->filters([
114
             ->filters([
112
         //
115
         //