Skip to content

Commit

Permalink
ITT: Laravel few versions support markers added.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-ivanov committed Mar 15, 2017
1 parent c33d5b4 commit ba79bee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Asserts/EloquentAsserts.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ protected function assertEloquentHasMany($class, $relation)
$parentKey = $parent->getKeyName();
$childModel = $hasManyRelation->getRelated();
$childKey = $childModel->getKeyName();

/** @laravel-versions */
$childForeignKey = method_exists($hasManyRelation, 'getForeignKeyName')
? $hasManyRelation->getForeignKeyName() : last(explode('.', $hasManyRelation->getForeignKey()));

Expand Down

0 comments on commit ba79bee

Please sign in to comment.