Skip to content

Commit

Permalink
Merge pull request #37 from dvsapps/main
Browse files Browse the repository at this point in the history
Added a defaultSort feature to the plugin
  • Loading branch information
rmsramos authored Jul 23, 2024
2 parents b1c8997 + 4d1873c commit 43417b0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ return [
'navigation_group' => null,
'navigation_icon' => 'heroicon-o-shield-check',
'navigation_sort' => null,
'default_sort_column' => 'id',
'default_sort_direction' => 'desc',
'navigation_count_badge' => false,
'resource' => \Rmsramos\Activitylog\Resources\ActivitylogResource::class,
],
Expand Down
2 changes: 2 additions & 0 deletions config/filament-activitylog.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
'navigation_group' => null,
'navigation_icon' => 'heroicon-o-shield-check',
'navigation_sort' => null,
'default_sort_column' => 'id',
'default_sort_direction' => 'desc',
'navigation_count_badge' => false,
'resource' => \Rmsramos\Activitylog\Resources\ActivitylogResource::class,
],
Expand Down
1 change: 1 addition & 0 deletions src/Resources/ActivitylogResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public static function table(Table $table): Table
static::getPropertiesColumnCompoment(),
static::getCreatedAtColumnCompoment(),
])
->defaultSort(config('filament-activitylog.resources.default_sort_column', 'created_at'), config('filament-activitylog.resources.default_sort_direction', 'asc'))
->filters([
static::getDateFilterComponent(),
static::getEventFilterCompoment(),
Expand Down

0 comments on commit 43417b0

Please sign in to comment.