From 3ea10f34eb920c260e56dd53d35371004f5cf8ed Mon Sep 17 00:00:00 2001 From: Ash Monsh Date: Sat, 13 May 2023 17:41:15 +0300 Subject: [PATCH 1/3] allow to configer navigation group --- config/zeus-wind.php | 5 +++++ docs/configuration.md | 5 +++++ src/Filament/Resources/DepartmentResource.php | 2 +- src/Filament/Resources/LetterResource.php | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/config/zeus-wind.php b/config/zeus-wind.php index 6ad9c78..4bdbb4d 100644 --- a/config/zeus-wind.php +++ b/config/zeus-wind.php @@ -68,4 +68,9 @@ * set the default status that all messages will have when received. */ 'default_status' => 'NEW', + + /** + * Navigation Group Label + */ + 'navigation_group_label' => 'wind', ]; diff --git a/docs/configuration.md b/docs/configuration.md index 88138bf..aa83d5b 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -61,5 +61,10 @@ return [ * set the default status that all messages will have when received */ 'default_status' => 'NEW', + + /** + * Navigation Group Label + */ + 'navigation_group_label' => 'wind', ]; ``` diff --git a/src/Filament/Resources/DepartmentResource.php b/src/Filament/Resources/DepartmentResource.php index 2461487..ede01a5 100644 --- a/src/Filament/Resources/DepartmentResource.php +++ b/src/Filament/Resources/DepartmentResource.php @@ -112,6 +112,6 @@ protected static function getNavigationLabel(): string protected static function getNavigationGroup(): ?string { - return __('Wind'); + return __(config('zeus-wind.navigation_group_label', __('Wind'))); } } diff --git a/src/Filament/Resources/LetterResource.php b/src/Filament/Resources/LetterResource.php index 5589339..bc5f0f1 100644 --- a/src/Filament/Resources/LetterResource.php +++ b/src/Filament/Resources/LetterResource.php @@ -114,6 +114,6 @@ protected static function getNavigationLabel(): string protected static function getNavigationGroup(): ?string { - return __('Wind'); + return __(config('zeus-wind.navigation_group_label', __('Wind'))); } } From 66ae816c62ed9a7fa053578deeea7f2d4ad6c27f Mon Sep 17 00:00:00 2001 From: Ash Monsh Date: Sat, 13 May 2023 17:46:35 +0300 Subject: [PATCH 2/3] fix for stan --- database/factories/DepartmentFactory.php | 4 ++-- database/factories/LetterFactory.php | 8 ++++++-- src/Console/PublishCommand.php | 18 +++++++++--------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/database/factories/DepartmentFactory.php b/database/factories/DepartmentFactory.php index 38bf87d..e4c7ad8 100644 --- a/database/factories/DepartmentFactory.php +++ b/database/factories/DepartmentFactory.php @@ -9,7 +9,7 @@ class DepartmentFactory extends Factory /** * The name of the factory's corresponding model. * - * @var string + * @return string */ public function getModel(): string { @@ -21,7 +21,7 @@ public function getModel(): string * * @return array */ - public function definition() + public function definition(): array { return [ 'name' => $this->faker->words(3, true), diff --git a/database/factories/LetterFactory.php b/database/factories/LetterFactory.php index 6e74475..50fc03e 100644 --- a/database/factories/LetterFactory.php +++ b/database/factories/LetterFactory.php @@ -6,6 +6,11 @@ class LetterFactory extends Factory { + /** + * The name of the factory's corresponding model. + * + * @return string + */ public function getModel(): string { return config('zeus-wind.models.letter'); @@ -16,9 +21,8 @@ public function getModel(): string * * @return array * - * @throws \JsonException */ - public function definition() + public function definition(): array { return [ 'name' => $this->faker->name, diff --git a/src/Console/PublishCommand.php b/src/Console/PublishCommand.php index d6a5375..f35c691 100644 --- a/src/Console/PublishCommand.php +++ b/src/Console/PublishCommand.php @@ -28,18 +28,18 @@ class PublishCommand extends Command public function handle() { // publish Wind files - $this->callSilent('vendor:publish', ['--tag' => 'zeus-wind-config', '--force' => $this->option('force') ?? false]); - $this->callSilent('vendor:publish', ['--tag' => 'zeus-wind-migrations', '--force' => $this->option('force') ?? false]); - $this->callSilent('vendor:publish', ['--tag' => 'zeus-wind-views', '--force' => $this->option('force') ?? false]); - $this->callSilent('vendor:publish', ['--tag' => 'zeus-wind-translations', '--force' => $this->option('force') ?? false]); + $this->callSilent('vendor:publish', ['--tag' => 'zeus-wind-config', '--force' => (bool) $this->option('force')]); + $this->callSilent('vendor:publish', ['--tag' => 'zeus-wind-migrations', '--force' => (bool) $this->option('force')]); + $this->callSilent('vendor:publish', ['--tag' => 'zeus-wind-views', '--force' => (bool) $this->option('force')]); + $this->callSilent('vendor:publish', ['--tag' => 'zeus-wind-translations', '--force' => (bool) $this->option('force')]); - $this->callSilent('vendor:publish', ['--tag' => 'zeus-wind-seeder', '--force' => $this->option('force') ?? false]); - $this->callSilent('vendor:publish', ['--tag' => 'zeus-wind-factories', '--force' => $this->option('force') ?? false]); + $this->callSilent('vendor:publish', ['--tag' => 'zeus-wind-seeder', '--force' => (bool) $this->option('force')]); + $this->callSilent('vendor:publish', ['--tag' => 'zeus-wind-factories', '--force' => (bool) $this->option('force')]); // publish Zeus files - $this->callSilent('vendor:publish', ['--tag' => 'zeus-config', '--force' => $this->option('force') ?? false]); - $this->callSilent('vendor:publish', ['--tag' => 'zeus-views', '--force' => $this->option('force') ?? false]); - $this->callSilent('vendor:publish', ['--tag' => 'zeus-assets', '--force' => $this->option('force') ?? false]); + $this->callSilent('vendor:publish', ['--tag' => 'zeus-config', '--force' => (bool) $this->option('force')]); + $this->callSilent('vendor:publish', ['--tag' => 'zeus-views', '--force' => (bool) $this->option('force')]); + $this->callSilent('vendor:publish', ['--tag' => 'zeus-assets', '--force' => (bool) $this->option('force')]); $this->output->success('Zeus and Wind has been Published successfully'); } From eb153e270d1973b2d7a585417f3904db96c654cd Mon Sep 17 00:00:00 2001 From: atmonshi Date: Sat, 13 May 2023 14:47:00 +0000 Subject: [PATCH 3/3] Fix styling --- database/factories/DepartmentFactory.php | 4 ---- database/factories/LetterFactory.php | 5 ----- 2 files changed, 9 deletions(-) diff --git a/database/factories/DepartmentFactory.php b/database/factories/DepartmentFactory.php index e4c7ad8..7e1abb5 100644 --- a/database/factories/DepartmentFactory.php +++ b/database/factories/DepartmentFactory.php @@ -8,8 +8,6 @@ class DepartmentFactory extends Factory { /** * The name of the factory's corresponding model. - * - * @return string */ public function getModel(): string { @@ -18,8 +16,6 @@ public function getModel(): string /** * Define the model's default state. - * - * @return array */ public function definition(): array { diff --git a/database/factories/LetterFactory.php b/database/factories/LetterFactory.php index 50fc03e..91b91a1 100644 --- a/database/factories/LetterFactory.php +++ b/database/factories/LetterFactory.php @@ -8,8 +8,6 @@ class LetterFactory extends Factory { /** * The name of the factory's corresponding model. - * - * @return string */ public function getModel(): string { @@ -18,9 +16,6 @@ public function getModel(): string /** * Define the model's default state. - * - * @return array - * */ public function definition(): array {