Permalink
Browse files

access pivot on resource

  • Loading branch information...
taylorotwell committed Sep 29, 2017
1 parent 3bf8632 commit 1f37ccc06485410fa0866c012b083a042c4cc73e
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/Illuminate/Http/Resources/ConditionallyLoadsAttributes.php
@@ -139,7 +139,9 @@ protected function whenPivotLoaded($table, $value, $default = null)
}
return $this->when(
$this->pivot && ($this->pivot instanceof $table || $this->pivot->getTable() === $table),
$this->resource->pivot &&
($this->resource->pivot instanceof $table ||
$this->resource->pivot->getTable() === $table),
...[$value, $default]
);
}

0 comments on commit 1f37ccc

Please sign in to comment.