Skip to content

Commit 260fc53

Browse files
authored
Merge pull request #1236 from hydephp/bugfixes
Update PostAuthor::all() to map entries into array keyed by username
2 parents 637b873 + 05ec1de commit 260fc53

File tree

1 file changed

+3
-1
lines changed
  • packages/framework/src/Framework/Features/Blogging/Models

1 file changed

+3
-1
lines changed

packages/framework/src/Framework/Features/Blogging/Models/PostAuthor.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ public static function get(string $username): static
7171
/** @return \Illuminate\Support\Collection<\Hyde\Framework\Features\Blogging\Models\PostAuthor> */
7272
public static function all(): Collection
7373
{
74-
return new Collection(Config::getArray('hyde.authors', []));
74+
return (new Collection(Config::getArray('hyde.authors', [])))->mapWithKeys(function (self $author): array {
75+
return [$author->username => $author];
76+
});
7577
}
7678

7779
public function __toString(): string

0 commit comments

Comments
 (0)