Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow to configure navigation group #36

Merged
merged 3 commits into from
May 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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')));
}
}