Skip to content

Commit

Permalink
Merge pull request #36 from lara-zeus/config-group
Browse files Browse the repository at this point in the history
allow to configure navigation group
  • Loading branch information
atmonshi authored May 13, 2023
2 parents 214ab6e + eb153e2 commit 7c61b9f
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 21 deletions.
5 changes: 5 additions & 0 deletions config/zeus-wind.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];
6 changes: 1 addition & 5 deletions database/factories/DepartmentFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ class DepartmentFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
public function getModel(): string
{
Expand All @@ -18,10 +16,8 @@ public function getModel(): string

/**
* Define the model's default state.
*
* @return array
*/
public function definition()
public function definition(): array
{
return [
'name' => $this->faker->words(3, true),
Expand Down
9 changes: 4 additions & 5 deletions database/factories/LetterFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@

class LetterFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*/
public function getModel(): string
{
return config('zeus-wind.models.letter');
}

/**
* Define the model's default state.
*
* @return array
*
* @throws \JsonException
*/
public function definition()
public function definition(): array
{
return [
'name' => $this->faker->name,
Expand Down
5 changes: 5 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];
```
18 changes: 9 additions & 9 deletions src/Console/PublishCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Filament/Resources/DepartmentResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,6 @@ protected static function getNavigationLabel(): string

protected static function getNavigationGroup(): ?string
{
return __('Wind');
return __(config('zeus-wind.navigation_group_label', __('Wind')));
}
}
2 changes: 1 addition & 1 deletion src/Filament/Resources/LetterResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,6 @@ protected static function getNavigationLabel(): string

protected static function getNavigationGroup(): ?string
{
return __('Wind');
return __(config('zeus-wind.navigation_group_label', __('Wind')));
}
}

0 comments on commit 7c61b9f

Please sign in to comment.