瀏覽代碼

badge title unique

Andrew 1 月之前
父節點
當前提交
a531dbb054
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. 3
    3
      app/Filament/Resources/BadgeResource.php

+ 3
- 3
app/Filament/Resources/BadgeResource.php 查看文件

@@ -48,9 +48,9 @@ class BadgeResource extends Resource
48 48
                             Translate::make()->schema(fn (string $locale) => [
49 49
                                 TextInput::make('title')->required($locale == 'zh_TW')
50 50
                                     ->unique(
51
-                                        table: Badge::class,  // Your model class
52
-                                        column: 'title',      // The translatable JSON column
53
-                                        ignoreRecord: true   // Ignore current record on updates
51
+                                        table: 'badges',
52
+                                        column: 'title->' . $locale,
53
+                                        ignoreRecord: true
54 54
                                     )
55 55
                                     ->maxLength(40)->label('徽章標題'),
56 56
                             ])