Skip to content

Commit

Permalink
Merge pull request #21 from carloeusebi/patch-1
Browse files Browse the repository at this point in the history
fix: fixed AuthLogResource Table default sort order
  • Loading branch information
swilla authored Dec 26, 2024
2 parents ccc8292 + 29a7a74 commit 727ed9c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Resources/AuthenticationLogResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ public static function table(Table $table): Table
{
return $table
->modifyQueryUsing(fn (Builder $query) => $query->with('authenticatable'))
->defaultSort(
config('filament-authentication-log.sort.column'),
config('filament-authentication-log.sort.direction'),
)
->columns([
Tables\Columns\TextColumn::make('authenticatable')
->label(trans('filament-authentication-log::filament-authentication-log.column.authenticatable'))
Expand All @@ -87,7 +91,7 @@ public static function table(Table $table): Table

return new HtmlString('<a href="'.route('filament.'.FilamentAuthenticationLogPlugin::get()->getPanelName().'.resources.'.Str::plural((Str::lower(class_basename($record->authenticatable::class)))).'.edit', ['record' => $record->authenticatable_id]).'" class="inline-flex items-center justify-center text-sm font-medium hover:underline focus:outline-none focus:underline filament-tables-link text-primary-600 hover:text-primary-500 filament-tables-link-action">'.$authenticatableDisplay.'</a>');
})
->sortable(),
->sortable(['authenticatable_id']),
Tables\Columns\TextColumn::make('ip_address')
->label(trans('filament-authentication-log::filament-authentication-log.column.ip_address'))
->searchable()
Expand Down

0 comments on commit 727ed9c

Please sign in to comment.