Skip to content

Commit e214e8a

Browse files
Merge pull request #36 from SvenSlijkoord/patch-1
Fix for getForeignKey() exception on Laravel > 5.8
2 parents a4111f0 + e18cc36 commit e214e8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Console/GenerateCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ protected function getPropertiesFromMethods($model)
277277
if ($relationObj instanceof Relation) {
278278
$relatedModel = '\\' . get_class($relationObj->getRelated());
279279
$relatedObj = new $relatedModel;
280-
$property = property_exists($relationObj, 'getForeignKeyName')
280+
$property = method_exists($relationObj, 'getForeignKeyName')
281281
? $relationObj->getForeignKeyName()
282282
: $relationObj->getForeignKey();
283283
$this->setProperty($property, 'factory(' . get_class($relationObj->getRelated()) . '::class)->create()->' . $relatedObj->getKeyName());

0 commit comments

Comments
 (0)