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