Skip to content

Commit

Permalink
Merge pull request #1012 from amosfolz/develop-caseInsensitive-findUn…
Browse files Browse the repository at this point in the history
…ique

Update Model.php
  • Loading branch information
lcharette authored Jul 6, 2019
2 parents 37a4a15 + 61da177 commit 3574750
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/sprinkles/core/src/Database/Models/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3574750

Please sign in to comment.