We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1ddd30 commit 2dd4944Copy full SHA for 2dd4944
src/Console/ModelsCommand.php
@@ -637,6 +637,17 @@ public function getPropertiesFromMethods($model)
637
);
638
639
if (strpos(get_class($relationObj), 'Many') !== false) {
640
+ if ($relationObj instanceof BelongsToMany) {
641
+ $pivot = get_class($relationObj->newPivot());
642
+ if ($pivot != 'Illuminate\Database\Eloquent\Relations\Pivot') {
643
+ $this->setProperty(
644
+ $relationObj->getPivotAccessor(),
645
+ $pivot,
646
+ true,
647
+ false
648
+ );
649
+ }
650
651
//Collection or array of models (because Collection is Arrayable)
652
$relatedClass = '\\' . get_class($relationObj->getRelated());
653
$collectionClass = $this->getCollectionClass($relatedClass);
0 commit comments