@@ 409-411 (lines=3) @@ | ||
406 | return $this->addRelation($method, $arguments[0]); |
|
407 | } |
|
408 | ||
409 | if (count($arguments) == 2 && $arguments[1] instanceof \Closure) { |
|
410 | return $this->addRelation($method, $arguments[1], $arguments[0]); |
|
411 | } |
|
412 | ||
413 | return $this->addField($method, array_get($arguments, 0))->setRelation(snake_case($method)); |
|
414 | } |
|
@@ 429-431 (lines=3) @@ | ||
426 | ||
427 | if (count($arguments) == 1 && is_callable($arguments[0])) { |
|
428 | return $this->addRelation($method, $arguments[0]); |
|
429 | } elseif (count($arguments) == 2 && is_callable($arguments[1])) { |
|
430 | return $this->addRelation($method, $arguments[1], $arguments[0]); |
|
431 | } |
|
432 | ||
433 | throw new \InvalidArgumentException('Invalid eloquent relation'); |
|
434 | } |