@@ 465-467 (lines=3) @@ | ||
462 | return $this->addRelation($method, $arguments[0]); |
|
463 | } |
|
464 | ||
465 | if (count($arguments) == 2 && $arguments[1] instanceof \Closure) { |
|
466 | return $this->addRelation($method, $arguments[1], $arguments[0]); |
|
467 | } |
|
468 | ||
469 | return $this->addField($method, Arr::get($arguments, 0))->setRelation(Str::snake($method)); |
|
470 | } |
|
@@ 485-487 (lines=3) @@ | ||
482 | ||
483 | if (count($arguments) == 1 && is_callable($arguments[0])) { |
|
484 | return $this->addRelation($method, $arguments[0]); |
|
485 | } elseif (count($arguments) == 2 && is_callable($arguments[1])) { |
|
486 | return $this->addRelation($method, $arguments[1], $arguments[0]); |
|
487 | } |
|
488 | ||
489 | throw new \InvalidArgumentException('Invalid eloquent relation'); |
|
490 | } |