Skip to content

Commit 4b8a3fc

Browse files
authored
Fix plural-singular modelForContext (#468)
1 parent b34ea46 commit 4b8a3fc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Tree.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ public function modelForContext(string $context)
4141
return $this->models[Str::studly($context)];
4242
}
4343

44+
if (isset($this->models[Str::studly(Str::plural($context))])) {
45+
return $this->models[Str::studly(Str::plural($context))];
46+
}
47+
4448
$matches = array_filter(array_keys($this->models), function ($key) use ($context) {
4549
return Str::endsWith($key, '/' . Str::studly($context));
4650
});

0 commit comments

Comments
 (0)