diff --git a/src/Illuminate/Database/Eloquent/Builder.php b/src/Illuminate/Database/Eloquent/Builder.php index 8370fafd6ea4..b3e8bede7159 100755 --- a/src/Illuminate/Database/Eloquent/Builder.php +++ b/src/Illuminate/Database/Eloquent/Builder.php @@ -510,7 +510,7 @@ public function firstOr($columns = ['*'], Closure $callback = null) public function value($column) { if ($result = $this->first([$column])) { - return $result->{$column}; + return $result->{Str::afterLast($column, '.')}; } } diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index f4ce285647ee..7c53199cdf63 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -31,7 +31,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn * * @var string */ - const VERSION = '6.20.0'; + const VERSION = '6.20.1'; /** * The base path for the Laravel installation. diff --git a/src/Illuminate/Support/Reflector.php b/src/Illuminate/Support/Reflector.php index 49913796c2f3..66392ca2f39a 100644 --- a/src/Illuminate/Support/Reflector.php +++ b/src/Illuminate/Support/Reflector.php @@ -26,6 +26,12 @@ public static function isCallable($var, $syntaxOnly = false) return false; } + if ($syntaxOnly && + (is_string($var[0]) || is_object($var[0])) && + is_string($var[1])) { + return true; + } + $class = is_object($var[0]) ? get_class($var[0]) : $var[0]; $method = $var[1]; diff --git a/tests/Support/SupportReflectorTest.php b/tests/Support/SupportReflectorTest.php index 95917219829f..df5b3e414e46 100644 --- a/tests/Support/SupportReflectorTest.php +++ b/tests/Support/SupportReflectorTest.php @@ -68,6 +68,8 @@ public function testIsCallable() $this->assertTrue(Reflector::isCallable([TestClassWithCallStatic::class, 'f'])); $this->assertFalse(Reflector::isCallable([new TestClassWithCallStatic, 'f'])); $this->assertFalse(Reflector::isCallable([new TestClassWithCallStatic])); + $this->assertFalse(Reflector::isCallable(['TotallyMissingClass', 'foo'])); + $this->assertTrue(Reflector::isCallable(['TotallyMissingClass', 'foo'], true)); } }