Skip to content

Commit

Permalink
Make association type dynamic on customer relation manager (#1924)
Browse files Browse the repository at this point in the history
Co-authored-by: alecritson <[email protected]>
  • Loading branch information
alecritson and alecritson authored Aug 28, 2024
1 parent f8255ea commit 1f22793
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/admin/resources/lang/en/relationmanagers.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
],
],
'table' => [
'description' => 'Associate customer groups to this product to determine it\'s availability.',
'description' => 'Associate customer groups to this :type to determine it\'s availability.',
'name' => [
'label' => 'Name',
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Filament\Forms\Form;
use Filament\Tables;
use Filament\Tables\Table;
use Illuminate\Support\Str;
use Lunar\Admin\Events\ProductCustomerGroupsUpdated;
use Lunar\Admin\Support\RelationManagers\BaseRelationManager;

Expand Down Expand Up @@ -85,7 +86,9 @@ public function getDefaultTable(Table $table): Table

return $table
->description(
$this->description ?: __('lunarpanel::relationmanagers.customer_groups.table.description')
$this->description ?: __('lunarpanel::relationmanagers.customer_groups.table.description', [
'type' => Str::lower(class_basename(get_class($this->getOwnerRecord()))),
])
)
->paginated(false)
->headerActions([
Expand Down

0 comments on commit 1f22793

Please sign in to comment.