diff --git a/packages/framework/src/Framework/Features/Blogging/Models/PostAuthor.php b/packages/framework/src/Framework/Features/Blogging/Models/PostAuthor.php index ec6b25cad15..a916c54a7a4 100644 --- a/packages/framework/src/Framework/Features/Blogging/Models/PostAuthor.php +++ b/packages/framework/src/Framework/Features/Blogging/Models/PostAuthor.php @@ -8,6 +8,7 @@ use Hyde\Facades\Author; use Hyde\Facades\Config; use Illuminate\Support\Collection; +use function strtolower; use function is_string; /** @@ -65,14 +66,14 @@ public static function getOrCreate(string|array $data): static /** Get an Author from the config, or create it. */ public static function get(string $username): static { - return static::all()->firstWhere('username', $username) ?? Author::create($username); + return static::all()->firstWhere('username', strtolower($username)) ?? Author::create($username); } /** @return \Illuminate\Support\Collection<\Hyde\Framework\Features\Blogging\Models\PostAuthor> */ public static function all(): Collection { return (new Collection(Config::getArray('hyde.authors', [])))->mapWithKeys(function (self $author): array { - return [$author->username => $author]; + return [strtolower($author->username) => $author]; }); }