From 4ad66ada1f147360c6b35fa812d65a9f3384033f Mon Sep 17 00:00:00 2001 From: Ed Stephenson Date: Thu, 10 Oct 2024 08:23:42 +0100 Subject: [PATCH 1/4] Update translation-manager.php Add cluster config variable --- config/translation-manager.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config/translation-manager.php b/config/translation-manager.php index ba53310..f0c0298 100644 --- a/config/translation-manager.php +++ b/config/translation-manager.php @@ -69,6 +69,18 @@ 'navigation_group' => null, + /* + |-------------------------------------------------------------------------- + | Clusters + |-------------------------------------------------------------------------- + | + | 'cluster' is the cluster in which the translation manager is displayed. + | For instance, it could be set to '\App\Filament\Clusters\Admin::class'. + | + */ + + 'cluster' => null, + /* |-------------------------------------------------------------------------- | Navigation Icon From 82005f706f0d086d3c0b154cf5ef55b21e8bd020 Mon Sep 17 00:00:00 2001 From: Ed Stephenson Date: Thu, 10 Oct 2024 08:26:21 +0100 Subject: [PATCH 2/4] Update LanguageLineResource.php Add getCluster function to override base class --- src/Resources/LanguageLineResource.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Resources/LanguageLineResource.php b/src/Resources/LanguageLineResource.php index 4cac6ee..fcdde0e 100644 --- a/src/Resources/LanguageLineResource.php +++ b/src/Resources/LanguageLineResource.php @@ -185,4 +185,9 @@ public static function getNavigationGroup(): ?string return config('translation-manager.navigation_group'); } + + public static function getCluster(): ?string + { + return config('translation-manager.cluster'); + } } From 0790a2b226392de633ab4619d200ca85fafc569f Mon Sep 17 00:00:00 2001 From: Jehizkia Date: Fri, 11 Oct 2024 14:19:00 +0200 Subject: [PATCH 3/4] Added cluster config to readme --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 47ab699..9facf99 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,16 @@ Disable registering the translation manager navigation on certain panel IDs. The ], ``` +### Adding to cluster +Example of adding the translation manager to a cluster: +```php +// config/translation-manager.php +[ + // ...Other config + 'cluster' => \App\Filament\Clusters\Products::class, +] +``` + ## Usage Once installed, the Translation Manager can be accessed via the Filament sidebar menu. Simply click on the "Translation Manager" link to access the translation management screen. From 730728b0f540345c358dd0320030d98396f2e5ea Mon Sep 17 00:00:00 2001 From: Jehizkia Date: Fri, 11 Oct 2024 14:20:13 +0200 Subject: [PATCH 4/4] Duster fixes --- config/translation-manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/translation-manager.php b/config/translation-manager.php index f0c0298..f09bf46 100644 --- a/config/translation-manager.php +++ b/config/translation-manager.php @@ -79,7 +79,7 @@ | */ - 'cluster' => null, + 'cluster' => null, /* |--------------------------------------------------------------------------