@@ 390-392 (lines=3) @@ | ||
387 | return $this->addRelation($method, $arguments[0]); |
|
388 | } |
|
389 | ||
390 | if (count($arguments) == 2 && $arguments[1] instanceof \Closure) { |
|
391 | return $this->addRelation($method, $arguments[1], $arguments[0]); |
|
392 | } |
|
393 | ||
394 | return $this->addField($method)->setRelation(snake_case($method)); |
|
395 | } |
|
@@ 410-412 (lines=3) @@ | ||
407 | ||
408 | if (count($arguments) == 1 && is_callable($arguments[0])) { |
|
409 | return $this->addRelation($method, $arguments[0]); |
|
410 | } elseif (count($arguments) == 2 && is_callable($arguments[1])) { |
|
411 | return $this->addRelation($method, $arguments[1], $arguments[0]); |
|
412 | } |
|
413 | ||
414 | throw new \InvalidArgumentException('Invalid eloquent relation'); |
|
415 | } |