| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | protected function belongsToManyThrough(string $related, string $through, string $foreign = null, string $pivot = null, string $pivotRelatedForeign = null, $pivotThroughForeign = null) |
||
| 12 | { |
||
| 13 | /** @var \Illuminate\Database\Eloquent\Model $relatedInstance */ |
||
| 14 | $relatedInstance = new $related; |
||
| 15 | |||
| 16 | /** @var \Illuminate\Database\Eloquent\Model $throughInstance */ |
||
| 17 | $throughInstance = new $through; |
||
| 18 | |||
| 19 | return new BelongsToManyThrough( |
||
| 20 | $relatedInstance->newQuery(), |
||
| 21 | $this, |
||
|
|
|||
| 22 | $relatedInstance, |
||
| 23 | $throughInstance, |
||
| 24 | $foreign ?? $this->getForeignKey(), |
||
| 25 | $pivot ?? $this->guessPivot($relatedInstance, $throughInstance), |
||
| 26 | $pivotRelatedForeign ?? $relatedInstance->getForeignKey(), |
||
| 27 | $pivotThroughForeign ?? $throughInstance->getForeignKey() |
||
| 28 | ); |
||
| 44 |