From 61da1771fd41a8aa57505d193e00b1896d55c4ac Mon Sep 17 00:00:00 2001 From: amosfolz <33728190+amosfolz@users.noreply.github.com> Date: Fri, 5 Jul 2019 21:39:09 -0400 Subject: [PATCH] Update Model.php Change so postgreSQL (and others) will be case insensitive --- app/sprinkles/core/src/Database/Models/Model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/sprinkles/core/src/Database/Models/Model.php b/app/sprinkles/core/src/Database/Models/Model.php index 33b7cbbb3..4ad00e5d3 100644 --- a/app/sprinkles/core/src/Database/Models/Model.php +++ b/app/sprinkles/core/src/Database/Models/Model.php @@ -68,7 +68,7 @@ public function attributeExists($key) */ public static function findUnique($value, $identifier, $checkDeleted = true) { - $query = static::where($identifier, $value); + $query = static::whereRaw("LOWER($identifier) = ?", [mb_strtolower($value)]); if ($checkDeleted) { $query = $query->withTrashed();