From 856d83783781850b697e13dce21a9303dee153a8 Mon Sep 17 00:00:00 2001 From: lee-to Date: Fri, 28 Jun 2024 07:08:48 +0000 Subject: [PATCH] [rector] Rector fixes --- src/Laravel/Fields/Relationships/BelongsToMany.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Laravel/Fields/Relationships/BelongsToMany.php b/src/Laravel/Fields/Relationships/BelongsToMany.php index e3e45886e..180927b15 100644 --- a/src/Laravel/Fields/Relationships/BelongsToMany.php +++ b/src/Laravel/Fields/Relationships/BelongsToMany.php @@ -213,13 +213,11 @@ public function getPreparedFields(): FieldsCollection { return $this->getFields()->prepareAttributes()->prepareReindex( parent: $this, - before: function (self $parent, Field $field): FormElement { - return (clone $field) - ->setColumn("{$this->getPivotAs()}.{$field->getColumn()}") - ->setNameAttribute($field->getColumn()) - ->setAttribute('class', 'pivotField') - ->withoutWrapper(); - }, + before: fn(self $parent, Field $field): FormElement => (clone $field) + ->setColumn("{$this->getPivotAs()}.{$field->getColumn()}") + ->setNameAttribute($field->getColumn()) + ->setAttribute('class', 'pivotField') + ->withoutWrapper(), performName: fn (string $name): string => str_replace("{$this->getPivotAs()}.", '', $name) ); }