Skip to content

Commit

Permalink
Add support for Nova usage
Browse files Browse the repository at this point in the history
  • Loading branch information
dennislindsey committed Dec 26, 2019
1 parent c947a4d commit f973e35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Relations/BelongsToThrough.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ protected function performJoins(Builder $query = null)
*/
public function getForeignKeyName(Model $model = null)
{
$table = ($model ?? $this->parent)->getTable();
$table = explode(' as ', ($model ?? $this->parent)->getTable())[0];

if (array_key_exists($table, $this->foreignKeyLookup)) {
return $this->foreignKeyLookup[$table];
Expand Down

0 comments on commit f973e35

Please sign in to comment.