Skip to content

Commit 0c1c195

Browse files
committed
formatting
1 parent 6115fc3 commit 0c1c195

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,8 @@ public function getRelationValue($key)
415415
// If the "attribute" exists as a method on the model, we will just assume
416416
// it is a relationship and will load and return results from the query
417417
// and hydrate the relationship's value on the "relationships" array.
418-
if (method_exists($this, $key) || (static::$relationResolvers[static::class][$key] ?? null)) {
418+
if (method_exists($this, $key) ||
419+
(static::$relationResolvers[get_class($this)][$key] ?? null)) {
419420
return $this->getRelationshipFromMethod($key);
420421
}
421422
}

src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ trait HasRelationships
5353
protected static $relationResolvers = [];
5454

5555
/**
56-
* Define a relation resolver.
56+
* Define a dynamic relation resolver.
5757
*
5858
* @param string $name
5959
* @param \Closure $callback

src/Illuminate/Database/Eloquent/Model.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1725,7 +1725,7 @@ public function __call($method, $parameters)
17251725
return $this->$method(...$parameters);
17261726
}
17271727

1728-
if ($resolver = static::$relationResolvers[static::class][$method] ?? null) {
1728+
if ($resolver = (static::$relationResolvers[get_class($this)][$method] ?? null)) {
17291729
return $resolver($this);
17301730
}
17311731

0 commit comments

Comments
 (0)