diff --git a/src/Fields/Relationships/MorphTo.php b/src/Fields/Relationships/MorphTo.php index 14530fd73..180b3860e 100644 --- a/src/Fields/Relationships/MorphTo.php +++ b/src/Fields/Relationships/MorphTo.php @@ -81,7 +81,7 @@ public function requestTypeValue(): string public function getTypes(): array { - if(empty($this->types)) { + if($this->types === []) { throw new FieldException('Morph types is required'); } @@ -108,7 +108,7 @@ public function values(): array if(is_null($this->formattedValueCallback())) { $this->setFormattedValueCallback( - fn($v) => $v->{$this->getSearchColumn(get_class($v))} + fn($v) => $v->{$this->getSearchColumn($v::class)} ); } @@ -132,7 +132,7 @@ protected function resolvePreview(): string ->append( $item ->{$this->getRelationName()} - ->{$this->getSearchColumn(get_class($item->{$this->getRelationName()}))} + ->{$this->getSearchColumn($item->{$this->getRelationName()}::class)} ) ->append(')') ->value();