File tree 1 file changed +3
-2
lines changed
packages/framework/src/Framework/Features/Blogging/Models
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 8
8
use Hyde \Facades \Author ;
9
9
use Hyde \Facades \Config ;
10
10
use Illuminate \Support \Collection ;
11
+ use function strtolower ;
11
12
use function is_string ;
12
13
13
14
/**
@@ -65,14 +66,14 @@ public static function getOrCreate(string|array $data): static
65
66
/** Get an Author from the config, or create it. */
66
67
public static function get (string $ username ): static
67
68
{
68
- return static ::all ()->firstWhere ('username ' , $ username ) ?? Author::create ($ username );
69
+ return static ::all ()->firstWhere ('username ' , strtolower ( $ username) ) ?? Author::create ($ username );
69
70
}
70
71
71
72
/** @return \Illuminate\Support\Collection<\Hyde\Framework\Features\Blogging\Models\PostAuthor> */
72
73
public static function all (): Collection
73
74
{
74
75
return (new Collection (Config::getArray ('hyde.authors ' , [])))->mapWithKeys (function (self $ author ): array {
75
- return [$ author ->username => $ author ];
76
+ return [strtolower ( $ author ->username ) => $ author ];
76
77
});
77
78
}
78
79
You can’t perform that action at this time.
0 commit comments