diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index 2368048f9..9cc287d69 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -726,7 +726,7 @@ public function getPropertiesFromMethods($model) $this->setProperty( $relationObj->getPivotAccessor(), - $this->getClassNameInDestinationFile($model, $pivot), + $pivot, true, false ); diff --git a/tests/Console/ModelsCommand/Pivot/__snapshots__/Test__test__1.php b/tests/Console/ModelsCommand/Pivot/__snapshots__/Test__test__1.php index 526abd748..b51b53dfd 100644 --- a/tests/Console/ModelsCommand/Pivot/__snapshots__/Test__test__1.php +++ b/tests/Console/ModelsCommand/Pivot/__snapshots__/Test__test__1.php @@ -11,13 +11,13 @@ /** * * - * @property-read \DifferentCustomPivot|\CustomPivot|null $pivot + * @property-read DifferentCustomPivot|CustomPivot|null $pivot * @property-read \Illuminate\Database\Eloquent\Collection $relationCustomPivotUsingSameAccessor * @property-read int|null $relation_custom_pivot_using_same_accessor_count - * @property-read \CustomPivot|null $customAccessor + * @property-read CustomPivot|null $customAccessor * @property-read \Illuminate\Database\Eloquent\Collection $relationWithCustomPivot * @property-read int|null $relation_with_custom_pivot_count - * @property-read \DifferentCustomPivot|null $differentCustomAccessor + * @property-read DifferentCustomPivot|null $differentCustomAccessor * @property-read \Illuminate\Database\Eloquent\Collection $relationWithDifferentCustomPivot * @property-read int|null $relation_with_different_custom_pivot_count * @property-read \Illuminate\Database\Eloquent\Collection $relationWithDifferentCustomPivotUsingSameAccessor