Skip to content

Commit

Permalink
Merge pull request #1236 from hydephp/bugfixes
Browse files Browse the repository at this point in the history
Update PostAuthor::all() to map entries into array keyed by username
  • Loading branch information
caendesilva authored Mar 8, 2023
2 parents 637b873 + 05ec1de commit 260fc53
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ public static function get(string $username): static
/** @return \Illuminate\Support\Collection<\Hyde\Framework\Features\Blogging\Models\PostAuthor> */
public static function all(): Collection
{
return new Collection(Config::getArray('hyde.authors', []));
return (new Collection(Config::getArray('hyde.authors', [])))->mapWithKeys(function (self $author): array {
return [$author->username => $author];
});
}

public function __toString(): string
Expand Down

0 comments on commit 260fc53

Please sign in to comment.