Skip to content

Commit 345a2ea

Browse files
calebdwCaleb White
andauthored
Fixed model:show registering getAttribute as a null accessor (#44683)
Co-authored-by: Caleb White <[email protected]>
1 parent a709c26 commit 345a2ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Foundation/Console/ShowModelCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ protected function getVirtualAttributes($model, $columns)
155155
|| $method->getDeclaringClass()->getName() !== get_class($model)
156156
)
157157
->mapWithKeys(function (ReflectionMethod $method) use ($model) {
158-
if (preg_match('/^get(.*)Attribute$/', $method->getName(), $matches) === 1) {
158+
if (preg_match('/^get(.+)Attribute$/', $method->getName(), $matches) === 1) {
159159
return [Str::snake($matches[1]) => 'accessor'];
160160
} elseif ($model->hasAttributeMutator($method->getName())) {
161161
return [Str::snake($method->getName()) => 'attribute'];

0 commit comments

Comments
 (0)