beyondcode / invoker-community

74 stars 2 forks source link

Unable to resolve the related model for relation: reactions (Spatie package?) #330

Open Jam0r85 opened 1 year ago

Jam0r85 commented 1 year ago

OS: darwin Invoker Version: 2.11.0 Laravel Version: 9.51.0 Local project: true PHP Binary: /opt/homebrew/bin/php Route: /mails/details?class=App%5CMail%5CPasswordResetMailable&project=local-t98NCT4vrvNchhCoHrLk7s

Error:

Exception 

  Unable to resolve the related model for relation: reactions
Please add @relatedModel doc block.

  at phar:/Applications/Invoker.app/Contents/Resources/invoker.phar/src/Factories/RelatedModelItem.php:43
     39▕         $phpdoc = new \_HumbugBox8e7f5be646a5\Barryvdh\Reflection\DocBlock($reflection, $context);
     40▕         if ($phpdoc->hasTag('relatedModel')) {
     41▕             $model = $phpdoc->getTagsByName('relatedModel')[0]->getContent();
     42▕         } else {
  ➜  43▕             throw new \Exception('Unable to resolve the related model for relation: ' . $reflection->getName() . '
     44▕ Please add @relatedModel doc block.');
     45▕         }
     46▕         return $model;
     47▕     }

  1   phar:/Applications/Invoker.app/Contents/Resources/invoker.phar/src/Factories/RelatedModelItem.php:31
      _HumbugBox8e7f5be646a5\Invoker\Factories\RelatedModelItem::getRelatedModelFromDocBlock(Object(ReflectionMethod))

  2   phar:/Applications/Invoker.app/Contents/Resources/invoker.phar/src/Factories/RelatedModelItem.php:23
      _HumbugBox8e7f5be646a5\Invoker\Factories\RelatedModelItem::getRelatedModel(Object(ReflectionMethod), Object(App\Models\User))

I have a feeling this relates to using Spatie\Comments as that's the only place I can find which uses a relation reactions.

Any ideas?