Skip to content

Commit

Permalink
feat: add configurable filament navigation group
Browse files Browse the repository at this point in the history
  • Loading branch information
ast21 committed Sep 3, 2024
1 parent 9f0f1db commit 391e0dc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/admin-kit-articles.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@
'enabled' => true,
'is_wysiwyg' => true,
],

'navigation_group_enabled' => false,
];
1 change: 1 addition & 0 deletions resources/lang/en/articles.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
'id' => 'ID',
'image' => 'Image',
'title' => 'Title',
'navigation_group' => 'News',
'slug' => 'Slug',
'content' => 'Content',
'short_content' => 'Short Content',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/ru/articles.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
'id' => 'ID',
'image' => 'Изображение',
'title' => 'Заголовок',
'navigation_group' => 'Новости',
'slug' => 'Slug',
'content' => 'Контент',
'short_content' => 'Короткий контент',
Expand Down
9 changes: 9 additions & 0 deletions src/UI/Filament/Resources/ArticleResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ class ArticleResource extends Resource

protected static ?string $navigationIcon = 'heroicon-o-document-text';

public static function getNavigationGroup(): ?string
{
if (! config('admin-kit-articles.navigation_group_enabled')) {
return null;
}

return __('admin-kit-articles::articles.resource.navigation_group');
}

public static function form(Form $form): Form
{
$components = [];
Expand Down

0 comments on commit 391e0dc

Please sign in to comment.