Skip to content

Commit

Permalink
update conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 5, 2021
1 parent a61cab1 commit 1fa20dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Illuminate/Http/Resources/CollectsResources.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ protected function collects()
}

if (Str::endsWith(class_basename($this), 'Collection') &&
class_exists($class = Str::replaceLast('Collection', '', get_class($this)))) {
(class_exists($class = Str::replaceLast('Collection', '', get_class($this))) ||
class_exists($class = Str::replaceLast('Collection', 'Resource', get_class($this))))) {
return $class;
}
}
Expand Down

0 comments on commit 1fa20dd

Please sign in to comment.