Skip to content

Commit

Permalink
get user's fieldname from config (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
enespolat24 authored Oct 5, 2023
1 parent 12bfb0b commit dfa0931
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions config/filament-spatie-roles-permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@
\App\Models\User::class,
],

'user_name_column' => 'name',

/*
* Define any other permission here
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function form(Form $form): Form
{
return $form
->schema([
TextInput::make('name')
TextInput::make(config('filament-spatie-roles-permissions.user_name_column'))
->label(__('filament-spatie-roles-permissions::filament-spatie.field.name')),
]);
}
Expand All @@ -53,7 +53,7 @@ public function table(Table $table): Table
// Support changing table heading by translations.
->heading(__('filament-spatie-roles-permissions::filament-spatie.section.users'))
->columns([
TextColumn::make('name')
TextInput::make(config('filament-spatie-roles-permissions.user_name_column'))
->searchable()
->label(__('filament-spatie-roles-permissions::filament-spatie.field.name')),
])
Expand Down

0 comments on commit dfa0931

Please sign in to comment.