File tree Expand file tree Collapse file tree 3 files changed +16
-12
lines changed Expand file tree Collapse file tree 3 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,12 @@ class TypeResource extends Resource
18
18
19
19
protected static ?string $ navigationIcon = 'heroicon-o-tag ' ;
20
20
21
+
22
+ public static function getTranslatableLocales (): array
23
+ {
24
+ return filament ('filament-types ' )->getLocals ();
25
+ }
26
+
21
27
public static function getNavigationLabel (): string
22
28
{
23
29
return trans ('filament-types::messages.title ' );
Original file line number Diff line number Diff line change @@ -18,11 +18,6 @@ public function getTitle(): string
18
18
19
19
protected static string $ resource = TypeResource::class;
20
20
21
- public static function getTranslatableLocales (): array
22
- {
23
- return ['en ' , 'ar ' ];
24
- }
25
-
26
21
protected function getHeaderActions (): array
27
22
{
28
23
return TypeResource \Actions \ManagePageActions::make ($ this );
Original file line number Diff line number Diff line change @@ -50,13 +50,16 @@ public function getId(): string
50
50
51
51
public function register (Panel $ panel ): void
52
52
{
53
- $ panel ->plugin (
54
- SpatieLaravelTranslatablePlugin::make ()
55
- ->defaultLocales ($ this ->getLocals ()),
56
- )
57
- ->resources ([
58
- TypeResource::class,
59
- ]);
53
+ if (!$ panel ->hasPlugin ('spatie-laravel-translatable ' )) {
54
+ $ panel ->plugin (
55
+ SpatieLaravelTranslatablePlugin::make ()
56
+ ->defaultLocales ($ this ->getLocals ()),
57
+ );
58
+ }
59
+
60
+ $ panel ->resources ([
61
+ TypeResource::class,
62
+ ]);
60
63
}
61
64
62
65
public function boot (Panel $ panel ): void
You can’t perform that action at this time.
0 commit comments